0

Hey all,
I would like to know why when having big data in mysql table, executing a query for the first time takes 0.1.. sec, but if executing again the same query later, it will take only 0.0006 sec ?
Exemple:
SELECT name FROM users where id > 310000 limit 20
takes: 0.1844 sec the first time executed
and it takes: 0.0006 sec when excecuted again

Is there caching or data management ?
The speed will stay permanently ~0.0006 after executing it for the first time ?

Thank you :)

2
Contributors
1
Reply
14
Views
3 Years
Discussion Span
Last Post by cereal
1

Yes, there are different caches, check the documentation for more information:

And there are some limitations, as the subqueries cannot be cached:

But if you use MariaDB, which is a fork of MySQL, you can cache even those queries:

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.