Reputation: 3759
We're developing a "Search Reporting" feature for a client. One of the requirements is that they can view a particular result and see which search terms lead to it.
Our search_results
table is simply a mapping of searches.id
to results.id
.
So we need to do a bulk insert into this table and need to know the fastest way to do this without severely impacting the performance of the search query.
The search reports are not required frequently, so the table likely be > 90% inserts. Also, the inserts are not required immediately, so deferring the storage is acceptable.
Our application is built on a standard LAMP stack.
We're open to suggestions for other methods for storing this data. Some other ideas we've looked at are:
Upvotes: 3
Views: 4879
Reputation: 13903
The following is a good overview on what you can do to speed up INSERT
s on MySQL 5.1: http://dev.mysql.com/doc/refman/5.1/en/insert-speed.html
Including
VALUES
listsINSERT DELAYED
featureUpvotes: 6