Bug #38720 SELECT DISTINCT on multiple attributes containing spaces in UTF8 are slow.
| Submitted: | 11 Aug 2008 14:07 | Modified: | 18 Jan 2018 13:11 |
|---|---|---|---|
| Reporter: | Roalt Zijlstra | Email Updates: | |
| Status: | Closed | Impact on me: | |
| Category: | MySQL Server: Charsets | Severity: | S2 (Serious) |
| Version: | 5.0, 5.1, 6.0 bzr | OS: | Linux (Etch 4.0(am64 and x86)) |
| Assigned to: | Assigned Account | CPU Architecture: | Any |
| Tags: | distinct, regression, SELECT, utf8 | ||
[11 Aug 2008 14:07]
Roalt Zijlstra
[11 Aug 2008 14:20]
Roalt Zijlstra
Hmm I mentioned 11 seconds... but that was in fact 23 seconds as stated in the SQL result.
[11 Aug 2008 17:33]
Valeriy Kravchuk
Thank you for a problem report. Please, try to repeat with a newer version, 5.0.67, and inform about the results.
[12 Aug 2008 8:03]
Roalt Zijlstra
I now also tested it with the 5.0.67 release glib23, but that one is not faster or slower then the earlier reported MySQL version. I recreated the testcase on a test server and there the Debian 5.0.32 MySQL takes 1 min 35.84 sec. The 5.0.67 takes 1 min 36.62 sec. The if conditioned query takes only 0.23 seconds. Extra info: if I do 'SELECT DISTICT name,email from tmp_result;' Then the query is fast, but that still doesn't resolve my problem, because users can create the 'SQL query' themselves.
[12 Aug 2008 10:37]
Sveta Smirnova
Thank you for the report. Verified as described using test case below (to get more significant results add more rows). Version 4.1 is not affectd. Test case: CREATE TABLE `tmp_result` ( `email` varchar(255) NOT NULL default '', `name` varchar(255) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; insert into tmp_result values(md5(rand()), ' '); insert into tmp_result select md5(rand()), name from tmp_result; insert into tmp_result select md5(rand()), name from tmp_result; insert into tmp_result select md5(rand()), name from tmp_result; insert into tmp_result select md5(rand()), name from tmp_result; insert into tmp_result select md5(rand()), name from tmp_result; insert into tmp_result select md5(rand()), name from tmp_result; insert into tmp_result select md5(rand()), name from tmp_result; insert into tmp_result select md5(rand()), name from tmp_result; insert into tmp_result select md5(rand()), name from tmp_result; insert into tmp_result select md5(rand()), name from tmp_result; insert into tmp_result select md5(rand()), name from tmp_result; insert into tmp_result select md5(rand()), name from tmp_result; select now(); --disable_result_log select DISTINCT email,name from tmp_result; --enable_result_log select now();
[18 Jan 2018 13:11]
Erlend Dahl
This was fixed in 5.7.8.
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.056 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
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.