[MDEV-30872] Plans for SELECT and DELETE with engine=InnoDB sometimes are changed on some environments in buildbot Created: 2023-03-17  Updated: 2023-03-17

Status: Open
Project: MariaDB Server
Component/s: Optimizer
Affects Version/s: 11.1
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Lena Startseva Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None

Attachments: Text File InnoDB unpredictable plan.txt    

 Description   

On some Buildbot environments cases like the following for the InnoDB engine may change their query plan. Rerunning the tests cases gives passed tests.

 explain select * from v1 where v1.c1 in
 (select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	PRIMARY	t1	ALL	t1_c2	NULL	NULL	NULL	32	Using where
+1	PRIMARY	t1	ref	t1_c2	t1_c2	5	const	8	Using where
 2	DEPENDENT SUBQUERY	a	ref	t1_c2	t1_c2	5	test.t1.c2	5	Using index
 explain delete from v1 where v1.c1 in
 (select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	PRIMARY	t1	ALL	t1_c2	NULL	NULL	NULL	32	Using where
+1	PRIMARY	t1	ref	t1_c2	t1_c2	5	const	8	Using where
 2	DEPENDENT SUBQUERY	a	ref	t1_c2	t1_c2	5	test.t1.c2	5	Using index
 delete from v1 where v1.c1 in
 (select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5;

Full mtr test is in attached file. Also all this cases present in file delete_use_source_cases_non_innodb.inc in 11.1 version


Generated at Thu Feb 08 10:19:32 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.