Not the answer you need?
Register and ask your own question!

Trying to use pt-archiver on a table with a foreign key.

joey.stolljoey.stoll EntrantCurrent User Role Beginner
So, I have two tables: product and product_data.

product_data has a foreign key to product (product_id).

I'll want to run pt-archiver twice: once for product_data, then once for product (due to the foreign key reference).

Product has a column: "created." I want to use this in my pt-archiver WHERE clause to archive:

--where "created < DATE(NOW()) - INTERVAL 730 DAY "

However, product_data has no such WHERE clause. It needs to join on product using the foreign key in order to check the created date.

So, is there a way to do a join like this in pt-archiver?
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.