Add feature forcing DELETE by primary key to pt-archiver
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Toolkit moved to https://jira.percona.com/projects/PT |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Currently pt-archiver resolves WHERE clause twice: first, when run SELECT to retrieve rows for bulk insert and then when runs DELETE.
For example, for my test run general query log contains:
SELECT /*!40001 SQL_NO_CACHE */ `id`,`f1`
then
DELETE QUICK FROM `test`.
But this is not effective for certain tables and conditions and can be avoided if option mysql_use_result used and DELETE is done via PRIMARY KEY access only.
Suggested fix: implement option, asking pt-archiver to force DELETE by PRIMARY KEY.
tags: | added: i59430 |
Also using mysql_use_result makes sorting with ORDER BY redundant and archiving process more effective.