explain.depesz.com

PostgreSQL's explain analyze made readable

Result: BwKK : Optimization for: Optimization for: Optimization for: plan #V1Ae; plan #wQHF; plan #eayj

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.002 0.110 ↓ 0.0 0 1

Subquery Scan on outcomes (cost=226.61..227.34 rows=21 width=4) (actual time=0.110..0.110 rows=0 loops=1)

  • Output: outcomes.market_id
  • Filter: outcomes.is_valid
  • Rows Removed by Filter: 1
  • Buffers: shared hit=16
2.          

CTE params

3. 0.007 0.009 ↑ 100.0 1 1

ProjectSet (cost=0.00..0.52 rows=100 width=40) (actual time=0.007..0.009 rows=1 loops=1)

  • Output: unnest('{128618}'::integer[]), unnest('{1}'::integer[]), unnest('{1.75}'::numeric[])
4. 0.002 0.002 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.002..0.002 rows=1 loops=1)

5. 0.003 0.108 ↑ 42.0 1 1

Unique (cost=226.09..226.40 rows=42 width=13) (actual time=0.105..0.108 rows=1 loops=1)

  • Output: eo.market_id, ((eo.fixed_odds_web = p.fixed_odds_web)), eo.outcome_no, eo.odds_version
  • Buffers: shared hit=16
6. 0.011 0.105 ↑ 3.5 12 1

Sort (cost=226.09..226.19 rows=42 width=13) (actual time=0.105..0.105 rows=12 loops=1)

  • Output: eo.market_id, ((eo.fixed_odds_web = p.fixed_odds_web)), eo.outcome_no, eo.odds_version
  • Sort Key: eo.market_id, eo.outcome_no, eo.odds_version DESC
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=16
7. 0.012 0.094 ↑ 3.5 12 1

Nested Loop (cost=0.43..224.96 rows=42 width=13) (actual time=0.048..0.094 rows=12 loops=1)

  • Output: eo.market_id, (eo.fixed_odds_web = p.fixed_odds_web), eo.outcome_no, eo.odds_version
  • Buffers: shared hit=16
8. 0.013 0.013 ↑ 100.0 1 1

CTE Scan on params p (cost=0.00..2.00 rows=100 width=40) (actual time=0.011..0.013 rows=1 loops=1)

  • Output: p.market_id, p.outcome_no, p.fixed_odds_web
9. 0.069 0.069 ↓ 12.0 12 1

Index Only Scan using market_outcomes_market_id_outcome_no_odds_version_fixed_odd_idx on iddaa.market_outcomes eo (cost=0.43..2.22 rows=1 width=18) (actual time=0.029..0.069 rows=12 loops=1)

  • Output: eo.market_id, eo.outcome_no, eo.odds_version, eo.fixed_odds_web
  • Index Cond: ((eo.market_id = p.market_id) AND (eo.outcome_no = p.outcome_no))
  • Heap Fetches: 12
  • Buffers: shared hit=16
Planning time : 0.299 ms
Execution time : 0.183 ms