Re: MySQL 5.5 Queries occasionally extremely slow
Posted by:
Rick James
Date: March 05, 2014 10:32PM
> WHERE latitude != '0.000000' AND activedate >= inactivedate
What percentage of the rows are filtered out by tose conditions?
Consider removing the rows that are not relevant.
> Group By Projects.ProjectID
> ORDER BY Projects.ProjectID ASC, source.sort_order ASC
The GROUP BY ends up with unique values for ProjectID, so the second part of the ORDER BY never does anything extra.
> LIMIT 30000
Is that a realistic limit? What happens if you take off the limit?
> SELECT lots of stuff
> Group By Projects.ProjectID
Do you understand that you get random values for the stuff that is not tied directly to ProjectID?
Or are you doing the GROUP BY just in case some of the JOINs generate multiple rows?
Since you have a GROUP_CONCAT(), I guess you are expecting multiple rows, but from which table?
If the GROUP_CONCAT() is coming from just one table, then this _might_ run faster:
SELECT ...
( SELECT GROUP_CONCAT FROM ... WHERE ... GROUP BY ... ) AS images_list,
...
then remove the relavant JOIN and outer GROUP BY.
Please, please, tag each field with an alias of the table it belongs to. It is hard to know what is coming from where. Also, shorter aliases help reduce clutter.
Please provide SHOW CREATE TABLEs.
Subject
Views
Written By
Posted
2465
March 03, 2014 05:33PM
1189
March 04, 2014 03:29AM
1013
March 04, 2014 12:43PM
1071
March 05, 2014 04:37AM
Re: MySQL 5.5 Queries occasionally extremely slow
985
March 05, 2014 10:32PM
914
March 10, 2014 02:18PM
1025
March 10, 2014 02:16PM
1179
March 04, 2014 01:24PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.