explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 2gPj

Settings
# exclusive inclusive rows x rows loops node
1. 0.132 66.450 ↑ 2.3 158 1

Sort (cost=745,716.23..745,717.15 rows=368 width=164) (actual time=66.443..66.450 rows=158 loops=1)

  • Sort Key: rankedquotes.client, rankedquotes.scope, rankedquotes.provider, rankedquotes.price_source, rankedquotes.instrument_id, rankedquotes.instrument_id_type, rankedquotes.quote_type, rankedquotes.field, rankedquotes.effective_at
  • Sort Method: quicksort Memory: 66kB
2. 0.082 66.318 ↑ 2.3 158 1

Subquery Scan on rankedquotes (cost=742,944.11..745,700.54 rows=368 width=164) (actual time=65.789..66.318 rows=158 loops=1)

  • Filter: (rankedquotes.rankvalue = 1)
  • Rows Removed by Filter: 474
3. 0.420 66.236 ↑ 116.3 632 1

WindowAgg (cost=742,944.11..744,781.73 rows=73,505 width=204) (actual time=65.785..66.236 rows=632 loops=1)

4.          

Initplan (forWindowAgg)

5. 0.013 0.013 ↑ 1.0 1 1

Index Scan using quotesmigration_client_idx on client (cost=0.28..8.29 rows=1 width=4) (actual time=0.012..0.013 rows=1 loops=1)

  • Index Cond: ((client = 'FINBOURNE'::text) AND (scope = 'LGIM-23'::text))
6. 0.330 65.803 ↑ 116.3 632 1

Sort (cost=742,935.81..743,119.57 rows=73,505 width=132) (actual time=65.774..65.803 rows=632 loops=1)

  • Sort Key: q.entity_ref, q.effective_at, q.as_at DESC
  • Sort Method: quicksort Memory: 113kB
7. 20.886 65.473 ↑ 116.3 632 1

Merge Join (cost=12.03..731,968.57 rows=73,505 width=132) (actual time=0.037..65.473 rows=632 loops=1)

  • Merge Cond: (q.entity_ref = e.id)
8. 0.543 0.543 ↑ 116.3 632 1

Index Scan using quotesmigration_bitemporally_uniq on quotes_migration q (cost=0.57..716,597.77 rows=73,505 width=72) (actual time=0.028..0.543 rows=632 loops=1)

  • Index Cond: ((client_ref = $0) AND (as_at <= '2019-11-09 00:00:00+00'::timestamp with time zone))
  • Filter: ((annulled_as_at IS NULL) OR (annulled_as_at > '2019-11-09 00:00:00+00'::timestamp with time zone))
9. 44.044 44.044 ↑ 1.0 356,504 1

Index Scan using entity_pkey on entity e (cost=0.42..13,628.98 rows=356,504 width=64) (actual time=0.006..44.044 rows=356,504 loops=1)

Planning time : 0.308 ms
Execution time : 66.519 ms