[MDEV-3255] LP:892725 - An efficient plan to execute a query is changed for a full scan plan after the first execution of PS Created: 2011-11-20 Updated: 2015-02-02 Resolved: 2012-10-04 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Critical |
| Reporter: | Igor Babaev | Assignee: | Igor Babaev |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | Launchpad | ||
| Attachments: |
|
| Description |
|
In the following scenario a full scan plan to execute a single-table query is chosen for a non-first execution The problem exists for mariadb-5.3 code line and can be demonstrated with the following test case: create table t1 (a int primary key, b int); prepare st from 'select * from t1 where a=8'; flush status; deallocate prepare st; drop table t1; You can see the problem from the following output when running this test case: MariaDB [test]> prepare st from 'select * from t1 where a=8'; MariaDB [test]> MariaDB [test]> execute st;
--
-- MariaDB [test]> show status like '%Handler_read%';
----------------------
---------------------- MariaDB [test]> flush status; MariaDB [test]> execute st;
--
-- MariaDB [test]> show status like '%Handler_read%';
----------------------
---------------------- MariaDB [test]> flush status; MariaDB [test]> select * from t1 use index() where a=3;
--
-- MariaDB [test]> show status like '%Handler_read%';
----------------------
---------------------- MariaDB [test]> flush status; MariaDB [test]> execute st;
--
-- MariaDB [test]> show status like '%Handler_read%';
----------------------
---------------------- |
| Comments |
| Comment by Rasmus Johansson (Inactive) [ 2011-12-13 ] |
|
Launchpad bug id: 892725 |