Page MenuHomeSoftware Heritage

Make sure the pagination in swh_snapshot_get_by_id uses the proper indexes
ClosedPublic

Authored by olasd on Fri, Jun 19, 4:52 PM.

Details

Summary

On uffizi, this query would use the snapshot_branch (name, target, target_type) index, which would match way too many rows and take forever.

Test Plan

tested the new function in a temp session on uffizi

Diff Detail

Repository
rDSTO Storage manager
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

olasd created this revision.Fri, Jun 19, 4:52 PM

Build is green

Patch application report for D3320 (id=11760)

Rebasing onto 16009078bc...

Current branch diff-target is up to date.
Changes applied before test
commit 20afcdc61ebe0b84ad65fc3702cd9949045c0ece
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Fri Jun 19 16:46:42 2020 +0200

    Make sure the pagination in swh_snapshot_get_by_id uses the proper indexes

See https://jenkins.softwareheritage.org/job/DSTO/job/tests-on-diff/315/ for more details.

anlambert accepted this revision.Fri, Jun 19, 5:15 PM

Thanks ! I could not reproduce locally because I was not using the belvedere db. Switching to it effectively made the timeout issue appear.

This revision is now accepted and ready to land.Fri, Jun 19, 5:15 PM
olasd updated this revision to Diff 11761.Fri, Jun 19, 5:23 PM

Add some comments to explain the rationale behind the function change

Build is green

Patch application report for D3320 (id=11761)

Rebasing onto 16009078bc...

Current branch diff-target is up to date.
Changes applied before test
commit 9514a1db60449ad9188e059b2214f5f5c39f4042
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Fri Jun 19 16:46:42 2020 +0200

    Make sure the pagination in swh_snapshot_get_by_id uses the proper indexes

See https://jenkins.softwareheritage.org/job/DSTO/job/tests-on-diff/316/ for more details.