pt-online-schema-change foreign key checks can be excessive even when alter-foreign-keys-method=none

Reported by Asher Feldman on 2012-05-16
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Toolkit
Undecided
Unassigned

Bug Description

In a mysql instance with approximately 100k tables over 1000 dbs, foreign key / child table checks can be prohibitively slow when attempting to run an osc in just one of those dbs. In this case, the time it would take to run against all 1000 dbs becomes a blocker.

As I know there are no foreign keys in the schema, I hoped that that setting --alter-foreign-keys-method=none would disable the child table checks, but that isn't the case in 2.1.1. I'm currently disabling in that case with the following patch in order to use pt-osc on this server :

--- pt-online-schema-change 2012-05-16 17:04:20.745625532 +0000
+++ pt-online-schema-change-2.1.1-no_child_table_patch 2012-05-07 20:31:17.246872621 +0000
@@ -5235,11 +5235,14 @@
    # ########################################################################
    # Get child tables of the original table, if necessary.
    # ########################################################################
- my $child_tables = find_child_tables(
- tbl => $orig_tbl,
- Cxn => $cxn,
- Quoter => $q,
- );
+ my $child_tables;
+ if ( $alter_fk_method ne 'none' ) {
+ $child_tables = find_child_tables(
+ tbl => $orig_tbl,
+ Cxn => $cxn,
+ Quoter => $q,
+ );
+ }
    if ( !$child_tables ) {
       if ( $alter_fk_method ) {
          warn "No foreign keys reference $orig_tbl->{name}; ignoring "

Daniel Nichter (daniel-nichter) wrote :

Ascher, I think this has already been fixed in bug 976108?

Changed in percona-toolkit:
status: New → Triaged
Brian Fraser (fraserbn) on 2012-11-01
Changed in percona-toolkit:
status: Triaged → Incomplete
Launchpad Janitor (janitor) wrote :

[Expired for Percona Toolkit because there has been no activity for 60 days.]

Changed in percona-toolkit:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers