use pt-online-schema-change to optimize table?

1,799 views
Skip to first unread message

Jacky Shu

unread,
Mar 23, 2012, 1:39:23 PM3/23/12
to Percona Discussion
All,

We know it is risky to optimize a big table because of table locking.
I was wondering whether pt OSC can also optimize table? Just like
there is no schema change.

Thanks,

Jacky

Baron Schwartz

unread,
Mar 24, 2012, 10:20:33 AM3/24/12
to percona-d...@googlegroups.com
Yes. You should be able to do --alter "engine=innodb" for this purpose.
This is essentially what OPTIMIZE does anyway.

Baron Schwartz

unread,
Mar 28, 2012, 10:56:06 AM3/28/12
to percona-d...@googlegroups.com
I wanted to follow up on this thread. For anyone who is interested in following progress on the new pt-online-schema-change, the code is public here:

https://code.launchpad.net/~percona-toolkit-dev/percona-toolkit/pt-osc-2.1.1

It is in the process of being ripped apart and put back together. Features are incomplete or missing, and the documentation hasn't been updated. But you may be interested to look at it anyway, and/or look at the spec we're implementing: https://blueprints.launchpad.net/percona-toolkit/+spec/redesign-pt-online-schema-change

- Baron

> --
> You received this message because you are subscribed to the Google Groups "Percona Discussion" group.
> To post to this group, send email to percona-d...@googlegroups.com.
> To unsubscribe from this group, send email to percona-discuss...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/percona-discussion?hl=en.
>

--
Win free MySQL conference tickets! http://goo.gl/mvZ4W

Maulik patel

unread,
Aug 20, 2018, 10:04:39 AM8/20/18
to Percona Discussion

I have recently intstalled PT in ubuntu my local system and run below command, it gived an error. please note that my table 'YYY' size is 20 GB.

root@maulik-papps:/home/maulik# pt-online-schema-change D=XXX,t=YYY,h=localhost,u=root --alter="ENGINE=InnoDB" --alter-foreign-keys-method="auto" --ask-pass --execute
Enter MySQL password: 
No slaves found. See --recursion-method if host maulik-papps has slaves.
Not checking slave lag because no slaves were found and --check-slave-lag was not specified.
Operation, tries, wait:
analyze_table, 10, 1
copy_rows, 10, 0.25
create_triggers, 10, 1
drop_triggers, 10, 1
swap_tables, 10, 1
update_foreign_keys, 10, 1
No foreign keys reference `XXX`.`YYY`; ignoring --alter-foreign-keys-method.
Altering `XXX`.`YYY`...
Creating new table...
Created new table XXX._YYY_new OK.
Altering new table...
Altered `XXX`.`_YYY_new` OK.
2018-08-17T19:16:20 Creating triggers...
2018-08-17T19:16:20 Created triggers OK.
2018-08-17T19:16:20 Copying approximately 29641786 rows...
2018-08-17T19:16:50 Dropping triggers...
2018-08-17T19:16:50 Dropped triggers OK.
2018-08-17T19:16:50 Dropping new table...
2018-08-17T19:16:50 Dropped new table OK.
`XXX`.`YYY` was not altered.
2018-08-17T19:16:50 Error copying rows from `XXX`.`YYY` to `XXX`.`_YYY_new`: Redundant argument in printf at /usr/bin/pt-online-schema-change line 3595.


From: https://jira.percona.com/browse/PT-1607?filter=-2

luke rayner

unread,
Aug 30, 2018, 10:17:10 AM8/30/18
to Percona Discussion
I am getting the exact same issue, did you manage to resolve it?
Reply all
Reply to author
Forward
0 new messages