Page MenuHomePhabricator

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

Authored by epriestley on Nov 19 2019, 6:10 PM.
Tags
None
Referenced Files
F18749747: D20921.diff
Sat, Oct 4, 5:01 AM
F18735648: D20921.id49860.diff
Wed, Oct 1, 2:44 AM
F18734116: D20921.id.diff
Tue, Sep 30, 10:48 PM
F18651865: D20921.id49859.diff
Sun, Sep 21, 5:47 AM
F18614214: D20921.id49860.diff
Sep 14 2025, 12:38 PM
F18567566: D20921.id.diff
Sep 9 2025, 3:55 PM
F18282623: D20921.diff
Aug 23 2025, 12:13 AM
F18100811: D20921.diff
Aug 9 2025, 12:06 PM
Subscribers
None

Details

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.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision was not accepted when it landed; it landed in state Needs Review.Nov 19 2019, 6:19 PM
This revision was automatically updated to reflect the committed changes.