Answer the question
In order to leave comments, you need to log in
What is the most winning strategy for counting likes?
Actually the question of speed when counting likes. The structure is as follows: table images
imgid,
Likeup
likedown
Table likes
I'd
Userid
Up
Direction
Created
Imageid
Indexes are configured on all IDs
As a result, is it worth bothering by making a trigger to insert like and update roles in the images table or just select count on the result set with each request . Image datasets 1000+ likes for each up to 10000+ General table of likes 10M records
Answer the question
In order to leave comments, you need to log in
Winning for what? Of course, it's faster to get an int than to aggregate every time
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question