-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
explain tidb_mdl_view contains CARTESIAN #46933
Comments
|
@wjhuang2016 PTAL |
/found gs |
/label affects-6.5 |
workaround if querying limition: only works for DDL with only 1 table, more than 1 won't work, such as CREATE OR REPLACE VIEW new_tidb_mdl_view as (
SELECT job_id,
json_extract(cast(cast(job_meta as char) as json), '$.schema_name') as db_name,
json_extract(cast(cast(job_meta as char) as json), '$.table_name') as table_name,
json_extract(cast(cast(job_meta as char) as json), '$.query') as query,
session_id,
txnstart,
tidb_decode_sql_digests(all_sql_digests, 4096) AS SQL_DIGESTS
FROM mysql.tidb_ddl_job,
information_schema.cluster_tidb_trx,
information_schema.cluster_processlist
WHERE tidb_ddl_job.processing = 1
AND Find_in_set(json_extract(cast(cast(job_meta as char) as json), '$.table_id'), cluster_tidb_trx.related_table_ids)
AND cluster_tidb_trx.session_id = cluster_processlist.id
); |
It's not a bug. So I remove the bug label. |
candidate_1m |
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
tiup playground v6.5.4
mysql --comments --host 127.0.0.1 --port 4000 -u root
tidb/session/bootstrap.go
Line 460 in a8bd506
2. What did you expect to see? (Required)
The execution plan contains CARTESIAN, and as the production ddl increases, the view query becomes slower and slower. Optimization is recommended.
3. What did you see instead (Required)
4. What is your TiDB version? (Required)
v6.5.4
ALL
The text was updated successfully, but these errors were encountered: