Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- evergreen=# explain analyze SELECT "ahr".id AS "id" FROM action.hold_request AS "ahr" INNER JOIN reporter.hold_request_record AS "rhrr" ON ( "rhrr".id = "ahr".id ) INNER JOIN metabib.metarecord_source_map AS "mmrsm" ON ( "mmrsm".source = "rhrr".bib_record ) WHERE "ahr".cancel_time IS NULL AND "ahr".capture_time IS NULL AND ( ( "ahr".prev_check_time IS NULL ) OR ( "ahr".prev_check_time <= '2025-10-31 09:30:01-0400' ) ) AND "ahr".fulfillment_time IS NULL AND ( mod("mmrsm".metarecord,'3') = 0 ) AND "ahr".frozen = 'f' ORDER BY "ahr".selection_depth DESC, "ahr".request_time, "ahr".prev_check_time;
- QUERY PLAN
- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- Gather Merge (cost=94213.15..94236.48 rows=200 width=24) (actual time=18832.888..18844.050 rows=967 loops=1)
- Workers Planned: 2
- Workers Launched: 2
- -> Sort (cost=93213.12..93213.37 rows=100 width=24) (actual time=18824.199..18824.217 rows=322 loops=3)
- Sort Key: ahr.selection_depth DESC, ahr.request_time, ahr.prev_check_time
- Sort Method: quicksort Memory: 50kB
- Worker 0: Sort Method: quicksort Memory: 50kB
- Worker 1: Sort Method: quicksort Memory: 49kB
- -> Nested Loop (cost=0.85..93209.80 rows=100 width=24) (actual time=148.113..18823.063 rows=322 loops=3)
- -> Nested Loop (cost=0.43..78146.67 rows=33901 width=4) (actual time=0.087..14475.666 rows=1607574 loops=3)
- -> Parallel Seq Scan on metarecord_source_map mmrsm (cost=0.00..24273.72 rows=3942 width=8) (actual time=0.027..133.636 rows=210201 loops=3)
- Filter: (mod(metarecord, '3'::bigint) = 0)
- Rows Removed by Filter: 420558
- -> Index Scan using reporter_hold_request_record_bib_record_idx on hold_request_record rhrr (cost=0.43..13.16 rows=51 width=12) (actual time=0.012..0.067 rows=8 loops=630603)
- Index Cond: (bib_record = mmrsm.source)
- -> Index Scan using hold_request_open_idx on hold_request ahr (cost=0.42..0.44 rows=1 width=24) (actual time=0.003..0.003 rows=0 loops=4822723)
- Index Cond: (id = rhrr.id)
- Filter: ((capture_time IS NULL) AND (NOT frozen) AND ((prev_check_time IS NULL) OR (prev_check_time <= '2025-10-31 09:30:01-04'::timestamp with time zone)))
- Rows Removed by Filter: 0
- Planning Time: 7.819 ms
- Execution Time: 18844.155 ms
- (21 rows)
Advertisement
Add Comment
Please, Sign In to add comment