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

Perf: Downgrade MDL to Table Level Locks #179

Open
KKould opened this issue Mar 25, 2024 · 0 comments
Open

Perf: Downgrade MDL to Table Level Locks #179

KKould opened this issue Mar 25, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@KKould
Copy link
Member

KKould commented Mar 25, 2024

It's kind of like a hierarchical lock and intention lock, but it is still a table level lock in most case, and multiple ddl on different table can execute concurrently.

session1                                        session2
select * from t;
                                               alter table t2 add column d int(ok)
                                               alter table t add column d int(block)

+-------------+--------------------+----------------+---------------------+
| OBJECT_TYPE | OBJECT_SCHEMA      | OBJECT_NAME    | LOCK_TYPE           |
+-------------+--------------------+----------------+---------------------+
| TABLE       | test               | t              | SHARED_READ         | 
| GLOBAL      | NULL               | NULL           | INTENTION_EXCLUSIVE | 
| BACKUP LOCK | NULL               | NULL           | INTENTION_EXCLUSIVE |
| SCHEMA      | test               | NULL           | INTENTION_EXCLUSIVE |
| TABLE       | test               | t              | SHARED_UPGRADABLE   |
| TABLESPACE  | NULL               | test/t         | INTENTION_EXCLUSIVE |
| TABLE       | test               | #sql-790d_b    | EXCLUSIVE           | 
| TABLE       | test               | t              | EXCLUSIVE           |
| TABLE       | performance_schema | metadata_locks | SHARED_READ         | 
+-------------+--------------------+----------------+---------------------+

I don't think implicitly submiting is a good thing, you can't even rollback(even when you kill it, it is crazy).

Originally posted by @crwen in #171 (comment)

@KKould KKould added the enhancement New feature or request label Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant