count distinct for more than 500,000 rows?
I have a strange situation. An InnoDB table with a couple million rows. A distinct on one of the columns was always yielding 0. With some binary search I found that it is the case then the id is smaller than 500,000 ? What's that all about?
mysql> select count(distinct theme_author) from url_item where id < 499999;
+------------------------------+
| count(distinct theme_author) |
+------------------------------+
| 36493 |
+------------------------------+
1 row in set (0.44 sec)
mysql> select count(distinct theme_author) from url_item where id < 500000;
+------------------------------+
| count(distinct theme_author) |
+------------------------------+
| 0 |
+------------------------------+
1 row in set (0.44 sec)
mysql> select version();
+-----------+
| version() |
+-----------+
| 5.6.12 |
+-----------+
Subject
Views
Written By
Posted
count distinct for more than 500,000 rows?
1495
October 16, 2013 02:59PM
710
October 17, 2013 09:45PM
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.