Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

read information_columns will produce cop request #36496

Closed
xiongjiwei opened this issue Jul 24, 2022 · 3 comments
Closed

read information_columns will produce cop request #36496

xiongjiwei opened this issue Jul 24, 2022 · 3 comments
Labels
affects-5.0 This bug affects 5.0.x versions. affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. affects-5.3 This bug affects 5.3.x versions. affects-5.4 This bug affects the 5.4.x(LTS) versions. severity/critical sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug. type/enhancement The issue or PR belongs to an enhancement.

Comments

@xiongjiwei
Copy link
Contributor

xiongjiwei commented Jul 24, 2022

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

create view with subquery like create view as select * from t where t.a > (select max(a) from t)

select * from information_schema.columns will produce cop request

if we have many views, it will make tikv/tiflash increase CPU usage

origin_img_v2_eec1fd42-ea93-438e-af12-39e40be65b3g

problem introduce by #22363

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

3. What did you see instead (Required)

4. What is your TiDB version? (Required)

@xiongjiwei xiongjiwei added the type/bug The issue is confirmed as a bug. label Jul 24, 2022
@xiongjiwei xiongjiwei changed the title read information_columns will produce cop request read information_columns will produce cop request Jul 24, 2022
@xiongjiwei
Copy link
Contributor Author

same risk with show columns from table

@tangenta
Copy link
Contributor

Related to #36426.

@tangenta
Copy link
Contributor

tangenta commented Jul 25, 2022

I think an efficient solution for #22316 is to store the data type in the view when it is created.

OK. The data type should be calculated dynamically because the table can be altered.

@ti-chi-bot ti-chi-bot added may-affects-4.0 This bug maybe affects 4.0.x versions. may-affects-5.0 This bug maybe affects 5.0.x versions. may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.0 may-affects-6.1 may-affects-6.2 labels Aug 2, 2022
@xiongjiwei xiongjiwei added affects-5.0 This bug affects 5.0.x versions. affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. and removed severity/moderate labels Aug 2, 2022
@xiongjiwei xiongjiwei added affects-5.3 This bug affects 5.3.x versions. affects-5.4 This bug affects the 5.4.x(LTS) versions. labels Aug 2, 2022
@ti-chi-bot ti-chi-bot removed may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.0 This bug maybe affects 5.0.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. labels Aug 2, 2022
@xiongjiwei xiongjiwei added the type/enhancement The issue or PR belongs to an enhancement. label Aug 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-5.0 This bug affects 5.0.x versions. affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. affects-5.3 This bug affects 5.3.x versions. affects-5.4 This bug affects the 5.4.x(LTS) versions. severity/critical sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug. type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

No branches or pull requests

4 participants