Skip to content

INFORMATION_SCHEMA.columns performance regression after fix #54343 #58184

@lance6716

Description

@lance6716

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

use test;
drop table if exists t;
create table t(a int);
insert into t values(1);
insert into t select * from t;
insert into t select * from t;
insert into t select * from t;
insert into t select * from t;
insert into t select * from t;
insert into t select * from t;
insert into t select * from t;
insert into t select * from t;
insert into t select * from t;
insert into t select * from t;
insert into t select * from t;
insert into t select * from t;
insert into t select * from t;
insert into t select * from t;
insert into t select * from t;
insert into t select * from t;
insert into t select * from t;
insert into t select * from t;
insert into t select * from t;
insert into t select * from t;
insert into t select * from t;
create view v as select * from t where a = (select max(t2.a) from t t2);
create view v2 as select * from t where a = (select max(t2.a) from t t2);
create view v3 as select * from t where a = (select max(t2.a) from t t2);
create view v4 as select * from t where a = (select max(t2.a) from t t2);
create view v5 as select * from t where a = (select max(t2.a) from t t2);
create view v6 as select * from t where a = (select max(t2.a) from t t2);
select count(1) from INFORMATION_SCHEMA.columns;

thanks for @wshwsh12

2. What did you expect to see? (Required)

before the fix, there's some warnings but the execution time is small

use v6.5.8

mysql> select count(1) from INFORMATION_SCHEMA.columns;
+----------+
| count(1) |
+----------+
|     4629 |
+----------+
1 row in set, 6 warnings (0.03 sec)

3. What did you see instead (Required)

after the fix, execution is slow

use nightly (~8.6)

mysql> select count(1) from INFORMATION_SCHEMA.columns;
+----------+
| count(1) |
+----------+
|     4981 |
+----------+
1 row in set (0.74 sec)

use v6.5.11

mysql> select count(1) from INFORMATION_SCHEMA.columns;
+----------+
| count(1) |
+----------+
|     4635 |
+----------+
1 row in set (0.66 sec)

4. What is your TiDB version? (Required)

Metadata

Metadata

Assignees

No one assigned

    Labels

    affects-6.5This bug affects the 6.5.x(LTS) versions.affects-7.1This bug affects the 7.1.x(LTS) versions.affects-7.5This bug affects the 7.5.x(LTS) versions.affects-8.1This bug affects the 8.1.x(LTS) versions.affects-8.5This bug affects the 8.5.x(LTS) versions.component/ddlThis issue is related to DDL of TiDB.report/customerCustomers have encountered this bug.severity/moderatetype/bugThe issue is confirmed as a bug.type/regression

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions