I have a query like this :
SELECT SQL_NO_CACHE columns_names FROM table_name WHERE conditions;
I use SQL_NO_CACHE in order to measure the real execution time.
Here's the problem : the first query is sometimes way slower than next ones. For example, first query may take around 2-10s to execute and next queries take around 300ms to execute. Btw, I do have indexes to optimize my query.
It seems like the Database is sleeping when there's no action or something like that. Is there a way to prevent that ?