Home > database >  Mysql every 5 minutes of the first query is very slow, the second query quickly, excuse me, how to s
Mysql every 5 minutes of the first query is very slow, the second query quickly, excuse me, how to s

Time:10-02

Mysql every 5 minutes of the first query is very slow (more than 10 seconds), the second query quickly (within 1 second), could you tell me, how to solve the problem of the

Open_tables is much lower 1600
Opened_tables 3683
Table_open_cache 2000


Need to change table_open_cache value? Or how should do

CodePudding user response:

With text posted ( don't map!
) the explain the select...
And
show index from

For analysis

CodePudding user response:

Slow for the first time, in fact is access to the stored data file data, the second fast, actually is take the MySQL cache data, five minutes later, may cache invalidation, lead to slow,

Suggest that the SQL query statement itself is slower, look at the execution plan (explain) , if you need help, can focus on the public "andyqian", can be online for you to solve!

CodePudding user response:

Because when you first to convert the SQL statement to the SQL command so slow
The second word already translate well so fast
After a period of time the cache clear away again

CodePudding user response:

Open the table is the result of the observed a period of time after you?
  • Related