se that column is updated quite a lot).
The first time a member signs in, the query in the worst cases take 20s (locking the table so other queries can’t run). I guess this is fair, a lot of posts and it have to count them one by one since we haven’t indexed read.
But my question is, now that the query has run, if we run the query again a minute later the query will not take a second. Even if the table is updated, so it shouldn’t be the query cache. Do mysql store sub results from the count before and use that?
Let say the member signs out and don’t return for a hour. Then the query will take 20s again.The question is caching. Database blocks gets cached after they are fetched from the disk and accessing them then is very quick.
Also select itself does not lock the table (I guess you’re using myISAM)- it is some concurrent updates what stall everything. okey. Then we understan