Answer the question
In order to leave comments, you need to log in
How to optimize UPDATE + 1?
To collect view statistics, the UPDATE + 1 construct is currently used.
However, recently, this operation has been too slow and it needs to be optimized somehow.
The first thing that came to mind was to store data in memcached and write to the database immediately UPDATE + 100 ..
Are there any other solutions for high-load projects?
Answer the question
In order to leave comments, you need to log in
insert delayed into tmp_table
Take all records from the temporary table by cron, count the number of records and update the counter
. Why is it faster?
Inserting a row does not block your entry in the table. The update will be called only by krone. There is such a solution in XenForo
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question