MySQL Forums
Forum List  »  Performance

Re: Real weird slow down with select count(distinct x) and high max_heap_table_size
Posted by: Ben Li
Date: April 01, 2010 07:28PM

got NO clue

mysql> set max_heap_table_size=1048576*64;
Query OK, 0 rows affected (0.00 sec)

mysql> select SQL_NO_CACHE count(distinct a) from dctest order by '';
+-------------------+
| count(distinct a) |
+-------------------+
| 5755225 |
+-------------------+
1 row in set (9.37 sec)

mysql> select SQL_NO_CACHE count(distinct a) from dctest order by ''\G
*************************** 1. row ***************************
count(distinct a): 5755225
1 row in set (9.32 sec)

mysql> set max_heap_table_size=1048576;
Query OK, 0 rows affected (0.00 sec)

mysql> select SQL_NO_CACHE count(distinct a) from dctest order by ''\G
*************************** 1. row ***************************
count(distinct a): 5755225
1 row in set (4.72 sec)

Options: ReplyQuote




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.