MySQL Forums
Forum List  »  Performance

Re: Slow COUNT + GROUP BY
Posted by: Matan K
Date: March 23, 2015 08:13AM

Hi,

Thank you for your insights. After moving the Primary key to be a new incrementing field, the day index cardinality is indeed smaller but performance is very bad (I had to force use of the index as mysql didn't choose to use it when running EXPLAIN).

Using a (uid, day) index gives high cardinality and is equal to our best performance so far (like FORCE PRIMARY in the original question)

Both of these cases are for the subquery + group by, the count distinct constantly gives 2x-3x worse performance for all the indexes.

Please let me know if you have any more ideas on improving the performance

Options: ReplyQuote


Subject
Views
Written By
Posted
1750
March 20, 2015 07:00AM
787
March 20, 2015 07:55AM
766
March 20, 2015 08:00AM
742
March 22, 2015 04:11PM
726
March 23, 2015 12:46AM
1102
March 23, 2015 02:45AM
1005
March 23, 2015 04:30AM
906
March 23, 2015 06:04AM
Re: Slow COUNT + GROUP BY
771
March 23, 2015 08:13AM
779
March 24, 2015 02:02AM
768
March 24, 2015 02:51AM
790
March 24, 2015 03:37AM


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.