1
0
mirror of https://github.com/MariaDB/server.git synced 2025-09-02 09:41:40 +03:00

MDEV-17613 MIN/MAX Optimization (Select tables optimized away) does not work

Current easy fix is not possible, because SELECT clones ha_partition
and then closes the clone which leads to unclosed transaction in
partitions we forcely prune out. We cound solve this by closing these
partitions (and release from transaction) in
change_partitions_to_open() at versioning conditions stage, but this
is problematic because table lock is acquired for each partition at
open stage and therefore must be released when we close partition
handler in change_partitions_to_open(). More details in MDEV-20376.

This should change after MDEV-20250 where mechanism of opening
partitions will be improved.

This reverts commit cdbac54df0.
This commit is contained in:
Aleksey Midenkov
2019-08-21 16:06:29 +03:00
parent 32ec5fb979
commit b96e4424fb
4 changed files with 6 additions and 66 deletions

View File

@@ -547,17 +547,6 @@ t1 CREATE TABLE `t1` (
create or replace table t1 (f int) with system versioning partition by hash(f);
insert delayed into t1 values (1);
#
# MDEV-17613 MIN/MAX Optimization (Select tables optimized away) does not work
#
create or replace table t1 (pk int primary key) with system versioning
partition by system_time (
partition p1 history,
partition pn current);
insert into t1 values (1), (2);
explain select max(pk) from t1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
#
# MDEV-20068 History partition rotation is not done under LOCK TABLES
#
create or replace table t1 (x int) with system versioning partition by system_time limit 1