samedi 28 février 2015

mysql select query slow down exponentially as table grows


I have the following query running on mysql 5.6 on my CENTOS server



select tb1.field2, tb1.field1, tb2.field1
from dns.table1 tb1, dns.table2 tb2
where tb1.field2 = tb2.field2
and tb1.field1 != tb2.field1


All relevant fields are indexed. on tables of 10 million records, it finishes within 400 econds, however, on 100 million records, it finishes within 10 hours!


Why? I suspect file swapping within mysql, what can be optimized on mysql? would increase buffer pool help?





Aucun commentaire:

Enregistrer un commentaire