November 13th, 2012, 04:47 AM
MySQL query takes long time to return
I have a query. On my local Windows 7 machine it takes 1.31 seconds to return the result. In the production database it takes 6 minutes and 15 seconds until it returns. The MySQL version on my local PC is 5.5.20 64-bit. In the production database the MySQL version is "mysql Ver 14.14 Distrib 5.1.55, for portbld-freebsd8.1 (amd64) using 5.2". That table is over 1.6 GB and over 26 million rows. Were using the InnoDB storage engine.
Have we exceeded some limit? Will deleting old rows in that table help? We don't want to loose old statistics unless we absolutely have to.
November 13th, 2012, 10:02 AM
You would need to show us the table creation statements and the actual query you are using.
26 million rows isn't all that large
run an explain on the query as well to see what indexes are being used.
November 13th, 2012, 10:34 AM
Do you have all 26 M rows in your development machine?
If you do then compare the execution plan between your development machine and your production server to see if there is a difference in execution plan.
(Sniped by Guelphdad )
November 13th, 2012, 01:54 PM