[MDEV-153] LIMIT_ROWS_EXAMINED: query with UNION, GROUP BY examines 25 times more rows than the limit allows: limit ~50K, Handler_tmp_write+Handler_read_rnd_next ~ 1.2M Created: 2012-02-15 Updated: 2012-02-17 Resolved: 2012-02-17 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Elena Stepanova | Assignee: | Timour Katchaounov (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Description |
|
The following query
on the test data finishes with the warning " 1930 Query execution was interrupted. The query examined at least 50339 rows...". According to the session status, it examines over 1.2 million rows:
EXPLAIN:
Optimizer_switch (default):
bzr version-info
Test case is attached. |
| Comments |
| Comment by Timour Katchaounov (Inactive) [ 2012-02-16 ] |
|
The problem was due to the fact that if UNION processing was aborted due to The fix is to re-enable LIMIT_ROWS_EXAMINED: === modified file 'sql/sql_union.cc' if (executed && !uncacheable && !describe) fake_select_lex->join->no_const_tables= TRUE; @@ -808,6 +809,8 @@ bool st_select_lex_unit::exec() |
| Comment by Timour Katchaounov (Inactive) [ 2012-02-17 ] |
|
The fix and test case added to |