Skip to content
Snippets Groups Projects
Commit 38987444 authored by Nicolas Dandrimont's avatar Nicolas Dandrimont
Browse files

postgresql: Rewrite swh_visit_find_by_date to properly use existing indexes

swh_visit_find_by_date tries to do an index only scan on `origin_visit
(origin, date)`. However, by sorting the results on an extra column (the
visit id), the postgresql planner would end up doing an index scan,
which times out on origins with lots of visits.

Splitting the work across two steps (first find the date, which works
with index only scans, then find the highest visit id, which usually
only returns one row) fixes this issue.
parent b352198e
No related branches found
Tags v1.11.0
1 merge request!1040postgresql: Rewrite swh_visit_find_by_date to properly use existing indexes
Pipeline #1452 failed with stage
in 0 seconds
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment