HomePhorge

Improve use of keys when iterating over commits in "bin/audit delete" and…

Description

Improve use of keys when iterating over commits in "bin/audit delete" and "bin/repository rebuild-identities"

Summary:
Fixes T13457. Ref T13444. When we iterate over commits in a particular repository, the default iteration strategy can't effectively use the keys on the table.

Tweak the ordering so the "<repositoryID, epoch, [id]>" key can be used.

Test Plan:

  • Ran bin/audit delete --repository X and bin/repository rebuild-identities --repository X before and after changes.
    • With just the key changes, performance was slightly better. My local data isn't large enough to really emphasize the key changes.
    • With the page size changes, performance was a bit better (~30%, but on 1-3 second run durations).
  • Used --trace and ran EXPLAIN ... on the new queries, saw them select the "<repositoryID, epoch, [id]>" key and report a bare "Using index condition" in the "Extra" column.

Maniphest Tasks: T13457, T13444

Differential Revision: https://secure.phabricator.com/D20921

Details

Provenance
epriestleyAuthored on Nov 19 2019, 10:05 AM
themackabuPushed on Mar 25 2025, 8:07 PM
Parents
rPa7aca500bcd1: Update repository identities after all mutations to users and email addresses
Branches
Unknown
Tags
Unknown

Event Timeline