explain.depesz.com

PostgreSQL's explain analyze made readable

Result: tpe6

Settings

Optimization(s) for this plan:

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

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

2. 0.001 0.015 ↑ 1.0 2 1

Subquery Scan on "*SELECT* 1" (cost=0.57..3.93 rows=2 width=179) (actual time=0.013..0.015 rows=2 loops=1)

3. 0.014 0.014 ↑ 1.0 2 1

Index Scan using test_pid_did on test (cost=0.57..3.91 rows=2 width=187) (actual time=0.012..0.014 rows=2 loops=1)

  • Index Cond: ((parent_id = 106) AND (draft_id = 2))
4. 0.001 0.015 ↑ 2.0 1 1

Subquery Scan on "*SELECT* 2" (cost=4.48..8.97 rows=2 width=179) (actual time=0.014..0.015 rows=1 loops=1)

5. 0.010 0.014 ↑ 2.0 1 1

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

  • Index Cond: ((parent_id = 106) AND (draft_id = 1))
  • Filter: (NOT (hashed SubPlan 1))
  • Rows Removed by Filter: 2
6.          

SubPlan (for Index Scan)

7. 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))
8. 0.003 0.055 ↓ 1.1 20 1

Subquery Scan on "*SELECT* 3" (cost=9.52..53.47 rows=19 width=179) (actual time=0.034..0.055 rows=20 loops=1)

9. 0.041 0.052 ↓ 1.1 20 1

Index Scan using test_pid_did on test test_2 (cost=9.52..53.28 rows=19 width=187) (actual time=0.033..0.052 rows=20 loops=1)

  • Index Cond: ((parent_id = 106) AND (draft_id = 0))
  • Filter: (NOT (hashed SubPlan 2))
  • Rows Removed by Filter: 2
10.          

SubPlan (for Index Scan)

11. 0.011 0.011 ↑ 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.007..0.011 rows=5 loops=1)

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