pt-online-schema-change find_child_tables slow
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Toolkit moved to https://jira.percona.com/projects/PT |
Fix Released
|
Medium
|
Carlos Salguero |
Bug Description
tested on
pt-online-
mysql Ver 14.14 Distrib 5.6.35-80.0, for debian-linux-gnu (x86_64) using readline 6.3
pt-online-
There are a couple of tickets referencing the inherit slowness of information schema. Most are closed because you can set --alter-
But, this does not solve the problem. It simply avoids it. What if you actually do want the foreign-keys ?
The real problem is that the query in pt-online-
Currently:
my $sql = "SELECT table_schema, table_name "
. "FROM information_
. "WHERE referenced_
. "AND referenced_
But... simply adding "table_
I propose:
my $sql = "SELECT table_schema, table_name "
. "FROM information_
. "WHERE table_schema=
. "AND referenced_
In the current version, foreign keys that are made across databases will be included. I my proposal, only foreign keys from the same database will be checked.
I can't find a reason why anyone would make a foreign key cross databases, but I'm sure there are some that do have a valid use case for this.
I believe the default way should only check the same table_schema. And if people want to check cross database they can do this using a extra flag?
I'm reporting this as a bug and not a blueprint, because the current code is simply not usable when working with a lot of databases. I hope this is ok.
Changed in percona-toolkit: | |
importance: | Undecided → Medium |
tags: | added: pt142 |
Changed in percona-toolkit: | |
status: | Fix Committed → Fix Released |
Hi,
Do you have any benchmark with those changes?
I would like to know how faster would it run.