I am trying to optimize our use of the pt-archiver to archive historical data from a large database. For each table we have defined an index on the columns used in the --where clause, in order to speed up selection. By default these indexes are not used in the queries that pt-archiver is generating to select data to archive, because the select statements include a force index for the primary key instead. However, when I include the index as -i option in the --source parameter, the pt-archiver now uses the indexes as intended, but generates a delete statement that also uses the columns of that index instead of doing a delete by primary key. Is there any way I can have a mix of both:
- use an given index for selecting rows to archive
- use primary key for deleting archived rows.