HomeSoftware Heritage

origin_visit_get_latest: Materialize subquery on 'origin' table.

Description

origin_visit_get_latest: Materialize subquery on 'origin' table.

postgresql's query planner does not understand the origin is unique, so it performs
a partial index scan on origin_visit_pkey, which is inefficient on origins with
many visits.

This commit itself is not enough to make it use the proper index,
but provides this necessary change that will be used by a future commit.

Details

Provenance
vlorentzAuthored on Mar 11 2022, 1:36 PM
vlorentzPushed on Mar 15 2022, 10:38 AM
Differential Revision
D7338: origin_visit_get_latest: Materialize subquery on 'origin' table.
Parents
rDSTOb0cdab58b71b: postgresql: Increase timeouts that often fail
Branches
Unknown
Tags
Unknown
Build Status
Buildable 27439
Build 42939: test-and-buildJenkins console · Jenkins