Strange behavior of the query EXPLAIN?

As far as I understand, if the entry is not found then the query pulls all the strings , as they just where about 500 is this correct ?

5a2fa7a0331f7318893375.png

See the brake work would not have soared. These records hang from 20 seconds to a few minutes , the table is innodb
June 10th 19 at 15:55
1 answer
June 10th 19 at 15:57
Solution
You need an index on the condition of the sample(the visits.idad), and not be useless iterate through all the lines and long wait. Although what you have, even without an index, brute force on some only 565 lines such requests "brake" causing issues...
I redo, I did not know that in this case the index not working - Chaya_Goldner commented on June 10th 19 at 16:00
Well based on the response above about the structure of the table, you just need to add a single-field index idad and all. Your existing is not good, he's not on that field(idus), though called idad for some reason. - Guiseppe commented on June 10th 19 at 16:03

Find more questions by tags MySQL