Skip to content

Commit 23dc12f

Browse files
author
Aditya A
committed
Bug #23046302 COUNT(*) MUCH SLOWER ON 5.7 THAN 5.6
ANALYSIS This is regression caused due to worklog 6742 which implemented ha_innobase::records() which always uses clustered index to get the row count. Previously optimizer chose secondary index which was smaller in size of clustered index to scan for rows and resulted in a quicker scan. FIX After discussion it was decided to remove this feature in 5.7. [#rb14040 Approved by Kevin and Oystein ]
1 parent 2d5b879 commit 23dc12f

19 files changed

+138
-101
lines changed

mysql-test/r/func_group_innodb.result

+5-4
Original file line numberDiff line numberDiff line change
@@ -133,25 +133,26 @@ select 1, max(1) from t1i where 1=99;
133133
1 NULL
134134
explain select count(*), min(7), max(7) from t1m, t1i;
135135
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
136-
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
136+
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table
137137
Warnings:
138138
Note 1003 /* select#1 */ select count(0) AS `count(*)`,min(7) AS `min(7)`,max(7) AS `max(7)` from `test`.`t1m` join `test`.`t1i`
139139
select count(*), min(7), max(7) from t1m, t1i;
140140
count(*) min(7) max(7)
141141
0 NULL NULL
142142
explain select count(*), min(7), max(7) from t1m, t2i;
143143
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
144-
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
144+
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table
145145
Warnings:
146146
Note 1003 /* select#1 */ select count(0) AS `count(*)`,min(7) AS `min(7)`,max(7) AS `max(7)` from `test`.`t1m` join `test`.`t2i`
147147
select count(*), min(7), max(7) from t1m, t2i;
148148
count(*) min(7) max(7)
149149
0 NULL NULL
150150
explain select count(*), min(7), max(7) from t2m, t1i;
151151
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
152-
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
152+
1 SIMPLE t2m NULL system NULL NULL NULL NULL 1 100.00 NULL
153+
1 SIMPLE t1i NULL ALL NULL NULL NULL NULL 1 100.00 NULL
153154
Warnings:
154-
Note 1003 /* select#1 */ select count(0) AS `count(*)`,min(7) AS `min(7)`,max(7) AS `max(7)` from `test`.`t2m` join `test`.`t1i`
155+
Note 1003 /* select#1 */ select count(0) AS `count(*)`,min(7) AS `min(7)`,max(7) AS `max(7)` from `test`.`t1i`
155156
select count(*), min(7), max(7) from t2m, t1i;
156157
count(*) min(7) max(7)
157158
0 NULL NULL

mysql-test/r/innodb_icp.result

+1-1
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ FROM t2)
561561
ORDER BY t1.c2;
562562
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
563563
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
564-
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
564+
2 SUBQUERY t2 NULL ALL NULL NULL NULL NULL 1 100.00 NULL
565565
Warnings:
566566
Note 1003 /* select#1 */ select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 0 order by `test`.`t1`.`c2`
567567
SELECT t1.c1

mysql-test/r/innodb_icp_all.result

+1-1
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ FROM t2)
561561
ORDER BY t1.c2;
562562
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
563563
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
564-
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
564+
2 SUBQUERY t2 NULL ALL NULL NULL NULL NULL 1 100.00 NULL
565565
Warnings:
566566
Note 1003 /* select#1 */ select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 0 order by `test`.`t1`.`c2`
567567
SELECT t1.c1

mysql-test/r/innodb_icp_none.result

+1-1
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ FROM t2)
560560
ORDER BY t1.c2;
561561
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
562562
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
563-
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
563+
2 SUBQUERY t2 NULL ALL NULL NULL NULL NULL 1 100.00 NULL
564564
Warnings:
565565
Note 1003 /* select#1 */ select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where 0 order by `test`.`t1`.`c2`
566566
SELECT t1.c1

mysql-test/r/partition_explicit_prune.result

+10-10
Original file line numberDiff line numberDiff line change
@@ -422,9 +422,9 @@ WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0;
422422
VARIABLE_NAME VARIABLE_VALUE
423423
HANDLER_COMMIT 3
424424
HANDLER_EXTERNAL_LOCK 2
425-
HANDLER_READ_FIRST 1
426-
HANDLER_READ_KEY 1
427-
HANDLER_READ_NEXT 3
425+
HANDLER_READ_FIRST 3
426+
HANDLER_READ_KEY 3
427+
HANDLER_READ_NEXT 4
428428
HANDLER_READ_RND_NEXT 38
429429
HANDLER_WRITE 53
430430
# + 1 commit
@@ -440,9 +440,9 @@ WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0;
440440
VARIABLE_NAME VARIABLE_VALUE
441441
HANDLER_COMMIT 3
442442
HANDLER_EXTERNAL_LOCK 2
443-
HANDLER_READ_FIRST 1
444-
HANDLER_READ_KEY 1
445-
HANDLER_READ_NEXT 3
443+
HANDLER_READ_FIRST 3
444+
HANDLER_READ_KEY 3
445+
HANDLER_READ_NEXT 4
446446
HANDLER_READ_RND_NEXT 57
447447
HANDLER_WRITE 71
448448
# No matching partition, only internal I_S.
@@ -454,9 +454,9 @@ WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0;
454454
VARIABLE_NAME VARIABLE_VALUE
455455
HANDLER_COMMIT 3
456456
HANDLER_EXTERNAL_LOCK 4
457-
HANDLER_READ_FIRST 1
458-
HANDLER_READ_KEY 1
459-
HANDLER_READ_NEXT 3
457+
HANDLER_READ_FIRST 3
458+
HANDLER_READ_KEY 3
459+
HANDLER_READ_NEXT 4
460460
HANDLER_READ_RND_NEXT 76
461461
HANDLER_WRITE 89
462462
# + 18 for unlock (same as lock above) (100 is not in pNeg, no match)
@@ -490,7 +490,7 @@ Warning 1681 'PARTITIONS' is deprecated and will be removed in a future release.
490490
Note 1003 /* select#1 */ select `test`.`tablealias`.`a` AS `a`,`test`.`tablealias`.`b` AS `b` from `test`.`t1` PARTITION (`subp3`) `tablealias`
491491
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 PARTITION (`p10-99`);
492492
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
493-
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
493+
1 SIMPLE t1 p10-99_subp4,p10-99_subp5 index NULL PRIMARY 4 NULL 1 100.00 Using index
494494
Warnings:
495495
Warning 1681 'PARTITIONS' is deprecated and will be removed in a future release.
496496
Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` PARTITION (`p10-99`)

mysql-test/r/partition_locking.result

+3-1
Original file line numberDiff line numberDiff line change
@@ -2427,7 +2427,9 @@ WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0;
24272427
VARIABLE_NAME VARIABLE_VALUE
24282428
HANDLER_COMMIT 1
24292429
HANDLER_EXTERNAL_LOCK 4
2430-
HANDLER_READ_KEY 1
2430+
HANDLER_READ_FIRST 1
2431+
HANDLER_READ_KEY 2
2432+
HANDLER_READ_RND_NEXT 2
24312433
HANDLER_WRITE 17
24322434
# 1 read_first
24332435
# 2 read_key, read_rnd_next

mysql-test/suite/gcol/r/gcol_select_innodb.result

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ count(*)
142142
5
143143
explain select count(*) from t1;
144144
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
145-
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
145+
1 SIMPLE t1 NULL index NULL c 5 NULL 5 100.00 Using index
146146
Warnings:
147147
Note 1003 /* select#1 */ select count(0) AS `count(*)` from `test`.`t1`
148148
# SELECT COUNT(DISTINCT <non-gcol>) FROM tbl_name

mysql-test/suite/innodb/include/innodb_wl6742_selects.inc renamed to mysql-test/suite/innodb/include/innodb_isolation_selects.inc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# These same selects are used many times in wl6742.test
1+
# These same selects are used many times in innodb_isolation.test
22

3-
--echo ########## innodb_wl6742_selects.inc ##########
3+
--echo ########## innodb_isolation_selects.inc ##########
44
SELECT * FROM t1;
55
SELECT COUNT(*) FROM t1; # Uses handler::records() and clustered index
66
SELECT COUNT(*) FROM t3; # Uses handler::records() and clustered index

mysql-test/suite/innodb/r/innodb-wl6742.result renamed to mysql-test/suite/innodb/r/innodb-isolation.result

+35-34
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ INDEX k2(c2)
3939
INSERT INTO t3 (SELECT * FROM t1);
4040
affected rows: 10
4141
info: Records: 10 Duplicates: 0 Warnings: 0
42-
########## innodb_wl6742_selects.inc ##########
42+
########## innodb_isolation_selects.inc ##########
4343
SELECT * FROM t1;
4444
c1 c2 c3 c4
4545
1 1 1 1
@@ -121,7 +121,7 @@ DELETE FROM t1 WHERE c1 = 6;
121121
affected rows: 1
122122
DELETE FROM t3 WHERE c1 = 6;
123123
affected rows: 1
124-
########## innodb_wl6742_selects.inc ##########
124+
########## innodb_isolation_selects.inc ##########
125125
SELECT * FROM t1;
126126
c1 c2 c3 c4
127127
1 3 1 1
@@ -194,7 +194,7 @@ COUNT(*)
194194
#
195195
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
196196
BEGIN;
197-
########## innodb_wl6742_selects.inc ##########
197+
########## innodb_isolation_selects.inc ##########
198198
SELECT * FROM t1;
199199
c1 c2 c3 c4
200200
1 1 1 1
@@ -275,7 +275,7 @@ INSERT INTO t1(c2,c3,c4) VALUES (100, 1, 1);
275275
affected rows: 1
276276
INSERT INTO t3(c2,c3,c4) VALUES (100, 1, 1);
277277
affected rows: 1
278-
########## innodb_wl6742_selects.inc ##########
278+
########## innodb_isolation_selects.inc ##########
279279
SELECT * FROM t1;
280280
c1 c2 c3 c4
281281
1 1 1 1
@@ -353,7 +353,7 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
353353
#
354354
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
355355
BEGIN;
356-
########## innodb_wl6742_selects.inc ##########
356+
########## innodb_isolation_selects.inc ##########
357357
SELECT * FROM t1;
358358
c1 c2 c3 c4
359359
1 1 1 1
@@ -431,7 +431,7 @@ INSERT INTO t1(c2,c3,c4) VALUES (1000, 1, 1);
431431
affected rows: 1
432432
INSERT INTO t3(c2,c3,c4) VALUES (1000, 1, 1);
433433
affected rows: 1
434-
########## innodb_wl6742_selects.inc ##########
434+
########## innodb_isolation_selects.inc ##########
435435
SELECT * FROM t1;
436436
c1 c2 c3 c4
437437
1 1 1 1
@@ -503,7 +503,7 @@ COUNT(*)
503503
#
504504
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
505505
BEGIN;
506-
########## innodb_wl6742_selects.inc ##########
506+
########## innodb_isolation_selects.inc ##########
507507
SELECT * FROM t1;
508508
c1 c2 c3 c4
509509
1 3 1 1
@@ -583,7 +583,7 @@ DELETE FROM t1 WHERE c1 in(9);
583583
affected rows: 1
584584
DELETE FROM t3 WHERE c1 in(9);
585585
affected rows: 1
586-
########## innodb_wl6742_selects.inc ##########
586+
########## innodb_isolation_selects.inc ##########
587587
SELECT * FROM t1;
588588
c1 c2 c3 c4
589589
1 3 1 1
@@ -652,7 +652,7 @@ COUNT(*)
652652
#
653653
# Connection default REPEATABLE READ
654654
#
655-
########## innodb_wl6742_selects.inc ##########
655+
########## innodb_isolation_selects.inc ##########
656656
SELECT * FROM t1;
657657
c1 c2 c3 c4
658658
1 3 1 1
@@ -723,7 +723,7 @@ COUNT(*)
723723
#
724724
# Connection 1 REPEATABLE READ
725725
#
726-
########## innodb_wl6742_selects.inc ##########
726+
########## innodb_isolation_selects.inc ##########
727727
SELECT * FROM t1;
728728
c1 c2 c3 c4
729729
1 1 1 1
@@ -793,7 +793,7 @@ COUNT(*)
793793
#
794794
# Connection 2 READ COMMITTED
795795
#
796-
########## innodb_wl6742_selects.inc ##########
796+
########## innodb_isolation_selects.inc ##########
797797
SELECT * FROM t1;
798798
c1 c2 c3 c4
799799
1 1 1 1
@@ -863,7 +863,7 @@ COUNT(*)
863863
#
864864
# Connection 3 READ UNCOMMITTED
865865
#
866-
########## innodb_wl6742_selects.inc ##########
866+
########## innodb_isolation_selects.inc ##########
867867
SELECT * FROM t1;
868868
c1 c2 c3 c4
869869
1 3 1 1
@@ -930,7 +930,7 @@ COUNT(*)
930930
4
931931
###############################################
932932
COMMIT;
933-
########## innodb_wl6742_selects.inc ##########
933+
########## innodb_isolation_selects.inc ##########
934934
SELECT * FROM t1;
935935
c1 c2 c3 c4
936936
1 3 1 1
@@ -999,7 +999,7 @@ COUNT(*)
999999
#
10001000
# Connection 2 READ COMMITTED
10011001
#
1002-
########## innodb_wl6742_selects.inc ##########
1002+
########## innodb_isolation_selects.inc ##########
10031003
SELECT * FROM t1;
10041004
c1 c2 c3 c4
10051005
1 1 1 1
@@ -1067,7 +1067,7 @@ COUNT(*)
10671067
4
10681068
###############################################
10691069
COMMIT;
1070-
########## innodb_wl6742_selects.inc ##########
1070+
########## innodb_isolation_selects.inc ##########
10711071
SELECT * FROM t1;
10721072
c1 c2 c3 c4
10731073
1 1 1 1
@@ -1137,7 +1137,7 @@ COUNT(*)
11371137
#
11381138
# Connection 1 REPEATABLE READ
11391139
#
1140-
########## innodb_wl6742_selects.inc ##########
1140+
########## innodb_isolation_selects.inc ##########
11411141
SELECT * FROM t1;
11421142
c1 c2 c3 c4
11431143
1 1 1 1
@@ -1214,7 +1214,7 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
12141214
SELECT COUNT(*) FROM t1 FOR UPDATE;
12151215
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
12161216
COMMIT;
1217-
########## innodb_wl6742_selects.inc ##########
1217+
########## innodb_isolation_selects.inc ##########
12181218
SELECT * FROM t1;
12191219
c1 c2 c3 c4
12201220
1 1 1 1
@@ -1291,17 +1291,17 @@ Warnings:
12911291
Note 1003 /* select#1 */ select `test`.`t1`.`c1` AS `c1`,`test`.`t1`.`c2` AS `c2`,`test`.`t1`.`c3` AS `c3`,`test`.`t1`.`c4` AS `c4` from `test`.`t1`
12921292
EXPLAIN SELECT COUNT(*) FROM t1;
12931293
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1294-
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
1294+
1 SIMPLE t1 NULL index NULL k2 5 NULL 9 100.00 Using index
12951295
Warnings:
12961296
Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1`
12971297
EXPLAIN SELECT COUNT(*) FROM t3;
12981298
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1299-
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
1299+
1 SIMPLE t3 p0,p1,p2,p3 index NULL k2 5 NULL 9 100.00 Using index
13001300
Warnings:
13011301
Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t3`
13021302
EXPLAIN SELECT COUNT(c1) FROM t1;
13031303
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1304-
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
1304+
1 SIMPLE t1 NULL index NULL k2 5 NULL 9 100.00 Using index
13051305
Warnings:
13061306
Note 1003 /* select#1 */ select count(`test`.`t1`.`c1`) AS `COUNT(c1)` from `test`.`t1`
13071307
EXPLAIN SELECT COUNT(c2) FROM t1;
@@ -1336,26 +1336,26 @@ Warnings:
13361336
Note 1003 /* select#1 */ select avg(`test`.`t3`.`c1`) AS `AVG(c1)`,max(`test`.`t3`.`c1`) AS `MAX(c1)`,min(`test`.`t3`.`c2`) AS `MIN(c2)`,avg(`test`.`t3`.`c3`) AS `AVG(c3)`,sum(`test`.`t3`.`c4`) AS `SUM(c4)` from `test`.`t3`
13371337
EXPLAIN SELECT c1, c2 FROM t1 WHERE c1 > ((SELECT COUNT(*) FROM t1) / 2);
13381338
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1339-
1 PRIMARY t1 NULL index PRIMARY k2 5 NULL # 100.00 Using where; Using index
1340-
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL # NULL Select tables optimized away
1339+
1 PRIMARY t1 NULL range PRIMARY PRIMARY 4 NULL # 100.00 Using where
1340+
2 SUBQUERY t1 NULL index NULL k2 5 NULL # 100.00 Using index
13411341
Warnings:
13421342
Note 1003 /* select#1 */ select `test`.`t1`.`c1` AS `c1`,`test`.`t1`.`c2` AS `c2` from `test`.`t1` where (`test`.`t1`.`c1` > <cache>(((/* select#2 */ select count(0) from `test`.`t1`) / 2)))
13431343
EXPLAIN SELECT c1, c2 FROM t1 WHERE c1 > ((SELECT COUNT(*) FROM t3) / 2);
13441344
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1345-
1 PRIMARY t1 NULL index PRIMARY k2 5 NULL # 100.00 Using where; Using index
1346-
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL # NULL Select tables optimized away
1345+
1 PRIMARY t1 NULL range PRIMARY PRIMARY 4 NULL # 100.00 Using where
1346+
2 SUBQUERY t3 p0,p1,p2,p3 index NULL k2 5 NULL # 100.00 Using index
13471347
Warnings:
13481348
Note 1003 /* select#1 */ select `test`.`t1`.`c1` AS `c1`,`test`.`t1`.`c2` AS `c2` from `test`.`t1` where (`test`.`t1`.`c1` > <cache>(((/* select#2 */ select count(0) from `test`.`t3`) / 2)))
13491349
EXPLAIN SELECT COUNT(c2) FROM t1 WHERE c1 > ((SELECT COUNT(*) FROM t1) / 2);
13501350
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1351-
1 PRIMARY t1 NULL index PRIMARY k2 5 NULL # 100.00 Using where; Using index
1352-
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL # NULL Select tables optimized away
1351+
1 PRIMARY t1 NULL range PRIMARY PRIMARY 4 NULL # 100.00 Using where
1352+
2 SUBQUERY t1 NULL index NULL k2 5 NULL # 100.00 Using index
13531353
Warnings:
13541354
Note 1003 /* select#1 */ select count(`test`.`t1`.`c2`) AS `COUNT(c2)` from `test`.`t1` where (`test`.`t1`.`c1` > <cache>(((/* select#2 */ select count(0) from `test`.`t1`) / 2)))
13551355
EXPLAIN SELECT COUNT(c2) FROM t1 WHERE c1 > ((SELECT COUNT(*) FROM t3) / 2);
13561356
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1357-
1 PRIMARY t1 NULL index PRIMARY k2 5 NULL # 100.00 Using where; Using index
1358-
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL # NULL Select tables optimized away
1357+
1 PRIMARY t1 NULL range PRIMARY PRIMARY 4 NULL # 100.00 Using where
1358+
2 SUBQUERY t3 p0,p1,p2,p3 index NULL k2 5 NULL # 100.00 Using index
13591359
Warnings:
13601360
Note 1003 /* select#1 */ select count(`test`.`t1`.`c2`) AS `COUNT(c2)` from `test`.`t1` where (`test`.`t1`.`c1` > <cache>(((/* select#2 */ select count(0) from `test`.`t3`) / 2)))
13611361
EXPLAIN SELECT COUNT(*) FROM t1 WHERE c1 > (SELECT AVG(c1) FROM t1);
@@ -1379,7 +1379,7 @@ ALTER TABLE t2 row_format=redundant;
13791379
# Connection default REPEATABLE READ
13801380
# Do more DML in the default REPEATABLE READ transaction in order to use recently committed records.
13811381
#
1382-
########## innodb_wl6742_selects.inc ##########
1382+
########## innodb_isolation_selects.inc ##########
13831383
SELECT * FROM t1;
13841384
c1 c2 c3 c4
13851385
1 3 1 1
@@ -1451,7 +1451,7 @@ info: Rows matched: 9 Changed: 9 Warnings: 0
14511451
UPDATE t3 SET c4 = c2 * 10;
14521452
affected rows: 9
14531453
info: Rows matched: 9 Changed: 9 Warnings: 0
1454-
########## innodb_wl6742_selects.inc ##########
1454+
########## innodb_isolation_selects.inc ##########
14551455
SELECT * FROM t1;
14561456
c1 c2 c3 c4
14571457
1 3 1 30
@@ -1536,7 +1536,7 @@ COMMIT;
15361536
SELECT COUNT(*) FROM t2;
15371537
COUNT(*)
15381538
10
1539-
########## innodb_wl6742_selects.inc ##########
1539+
########## innodb_isolation_selects.inc ##########
15401540
SELECT * FROM t1;
15411541
c1 c2 c3 c4
15421542
1 3 1 30
@@ -1605,7 +1605,7 @@ COUNT(*)
16051605
#
16061606
# Connection 2
16071607
#
1608-
########## innodb_wl6742_selects.inc ##########
1608+
########## innodb_isolation_selects.inc ##########
16091609
SELECT * FROM t1;
16101610
c1 c2 c3 c4
16111611
1 3 1 30
@@ -1866,7 +1866,7 @@ INSERT INTO t1(c1) SELECT c1 + 100 FROM t1;
18661866
CREATE TABLE t2 SELECT * FROM t1;
18671867
EXPLAIN SELECT COUNT(*) FROM t1;
18681868
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1869-
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
1869+
1 SIMPLE t1 NULL index NULL c2_idx 4 NULL 12 100.00 Using index
18701870
Warnings:
18711871
Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1`
18721872
EXPLAIN SELECT COUNT(*) FROM t1 FORCE INDEX(c2_idx);
@@ -1876,7 +1876,8 @@ Warnings:
18761876
Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` FORCE INDEX (`c2_idx`)
18771877
EXPLAIN SELECT COUNT(*) FROM t1, t2;
18781878
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1879-
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
1879+
1 SIMPLE t1 NULL index NULL c2_idx 4 NULL 12 100.00 Using index
1880+
1 SIMPLE t2 NULL ALL NULL NULL NULL NULL 12 100.00 Using join buffer (Block Nested Loop)
18801881
Warnings:
18811882
Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from `test`.`t1` join `test`.`t2`
18821883
EXPLAIN SELECT COUNT(*) FROM t1 FORCE INDEX(c2_idx), t2;

0 commit comments

Comments
 (0)