Bug #3904 COUNT DISTINCT performance anomaly in 4.1
Submitted: 27 May 2004 4:07 Modified: 10 Jun 2004 1:37
Reporter: Dean Ellis
Status: Closed
Category:Server Severity:S2 (Serious)
Version:4.1.2 OS:Linux (Linux)
Assigned to: Konstantin Osipov Target Version:

[27 May 2004 4:07] Dean Ellis
Description:
4.1.2 processes a particular COUNT(DISTINCT ...) type of query dramatically slower than
4.0.20.  You can watch the speed with which the temp file is created to get an idea of
just how much slower.

How to repeat:
CREATE TABLE t1 ( a text, b char(1) );

Load with random data (100K rows should be enough to demonstrate).

SELECT COUNT(DISTINCT b, a) FROM t1;
SELECT COUNT(DISTINCT a, b) FROM t1;

Both are processed reasonably quickly in 4.0.  The latter is orders of magnitude slower
in 4.1, though the former remains quick.

Suggested fix:
n/a
[9 Jun 2004 22:53] Konstantin Osipov
bk commit - 4.1 tree (konstantin:1.1912) BUG#3904
[10 Jun 2004 1:37] Konstantin Osipov
Fixed in 4.1.3