| Bug #42908 | Performance degradation on SELECT_DISTINCT_RANGES (as in Sysbench) | ||
|---|---|---|---|
| Submitted: | 17 Feb 2:20 | Modified: | 3 Jul 13:12 |
| Reporter: | Elena Stepanova | ||
| Status: | Analyzing | ||
| Category: | Server | Severity: | S5 (Performance) |
| Version: | 5.0.74, 5.0.76, 5.0.77 | OS: | Linux (SLES 10) |
| Assigned to: | Elena Stepanova | Target Version: | |
| Triage: | Needs Triage: D4 (Minor) | ||
[17 Feb 2:20]
Elena Stepanova
[17 Feb 11:16]
Elena Stepanova
Just to clarify this, SELECT_DISTINCT_RANGES is a scenario executing queries of the type: SELECT DISTINCT c FROM sbtest WHERE id BETWEEN N and M ORDER BY c Note on 'how to repeat': To pre-configure a test run, sbtest database needs to be created, and sysbench needs to be executed in prepare mode. <start server> <create database sbtest> sysbench <options> prepare sysbench <options> run
[23 Feb 3:39]
Elena Stepanova
Creates a database, a table (sysbench-like), and populates the table
Attachment: 42908_prepare.sql (application/octet-stream, text), 784 bytes.
[23 Feb 3:40]
Elena Stepanova
Runs a few sysbench-like SELECT DISTINCT queries along with EXPLAIN
Attachment: 42908_run.sql (application/octet-stream, text), 872 bytes.
[23 Feb 4:15]
Elena Stepanova
Result of 42908_run.sql execution on box #2
Attachment: 42908_run_result.txt (text/plain), 9.62 KiB.
[23 Feb 4:17]
Elena Stepanova
The attached scripts can be used to reproduce the problem without sysbench. They use wider
ranges in SELECT, so the difference is visible on single queries.
- start the server;
- use prepare script to create and populate the table;
mysql -uroot -n -vvv < ./42908_prepare.sql
- restart the server (not strictly necessary, but it makes the results clearer);
- use run script
mysql -uroot -n -vvv < ./42908_run.sql
It executes several queries of the same type as the sysbench scenario does, but with
bigger ranges for BETWEEN.
Each query is preceded by EXPLAIN.
The result is also attached, as it does not fit into the comment size.
In summary, while there seems to be no difference in explain output, execution time shows
that the same queries on 5.0.74 work slower than on 5.0.72.
