explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Hsix : Bad selectivity with subquery filter

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 548,042.701 548,042.762 ↑ 12,713.3 31,900 1

Seq Scan on ledger (cost=0.36..35,086,137.32 rows=405,552,959 width=152) (actual time=140,984.863..548,042.762 rows=31,900 loops=1)

  • Filter: (created > $2)
  • Rows Removed by Filter: 1216279604
  • Buffers: shared hit=1940686 read=17937218
  • I/O Timings: read=9.573
2.          

CTE current_rollup

3. 0.002 0.059 ↑ 1.0 1 1

Result (cost=0.33..0.34 rows=1 width=8) (actual time=0.059..0.059 rows=1 loops=1)

  • Buffers: shared hit=3
4.          

Initplan (for Result)

5. 0.002 0.057 ↑ 1.0 1 1

Limit (cost=0.29..0.33 rows=1 width=8) (actual time=0.056..0.057 rows=1 loops=1)

  • Buffers: shared hit=3
6. 0.055 0.055 ↑ 8,509.0 1 1

Index Only Scan using ledger_zerosum_rollup__window_end on ledger_zerosum_rollup (cost=0.29..399.19 rows=8,509 width=8) (actual time=0.055..0.055 rows=1 loops=1)

  • Index Cond: (window_end IS NOT NULL)
  • Heap Fetches: 1
  • Buffers: shared hit=3
7.          

Initplan (for Seq Scan)

8. 0.061 0.061 ↑ 1.0 1 1

CTE Scan on current_rollup (cost=0.00..0.02 rows=1 width=8) (actual time=0.060..0.061 rows=1 loops=1)

  • Buffers: shared hit=3
Planning time : 0.242 ms
Execution time : 548,044.430 ms