explain.depesz.com

PostgreSQL's explain analyze made readable

Result: kvej : Optimization for: Optimization for: plan #tpe6; plan #PymM

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.003 0.065 ↑ 1.0 23 1

Append (cost=0.57..66.48 rows=23 width=16) (actual time=0.013..0.065 rows=23 loops=1)

  • Buffers: shared hit=58
2. 0.015 0.015 ↑ 1.0 2 1

Index Scan using test_pid_did on test (cost=0.57..3.91 rows=2 width=16) (actual time=0.013..0.015 rows=2 loops=1)

  • Index Cond: ((parent_id = 106) AND (draft_id = 2))
  • Buffers: shared hit=6
3. 0.011 0.015 ↑ 2.0 1 1

Index Scan using test_pid_did on test test_1 (cost=4.48..8.95 rows=2 width=16) (actual time=0.014..0.015 rows=1 loops=1)

  • Index Cond: ((parent_id = 106) AND (draft_id = 1))
  • Filter: (NOT (hashed SubPlan 1))
  • Rows Removed by Filter: 2
  • Buffers: shared hit=13
4.          

SubPlan (forIndex Scan)

5. 0.004 0.004 ↑ 1.0 2 1

Index Scan using test_pid_did on test test_3 (cost=0.57..3.91 rows=2 width=8) (actual time=0.003..0.004 rows=2 loops=1)

  • Index Cond: ((parent_id = 106) AND (draft_id = 2))
  • Buffers: shared hit=6
6. 0.025 0.032 ↓ 1.1 20 1

Index Scan using test_pid_did on test test_2 (cost=9.52..53.28 rows=19 width=16) (actual time=0.014..0.032 rows=20 loops=1)

  • Index Cond: ((parent_id = 106) AND (draft_id = 0))
  • Filter: (NOT (hashed SubPlan 2))
  • Rows Removed by Filter: 2
  • Buffers: shared hit=39
7.          

SubPlan (forIndex Scan)

8. 0.007 0.007 ↑ 1.0 5 1

Index Scan using test_pid_did on test test_4 (cost=0.57..8.94 rows=5 width=8) (actual time=0.004..0.007 rows=5 loops=1)

  • Index Cond: ((parent_id = 106) AND (draft_id = ANY ('{2,1}'::bigint[])))
  • Buffers: shared hit=13
Planning time : 0.213 ms