explain.depesz.com

PostgreSQL's explain analyze made readable

Result: FLt

Settings
# exclusive inclusive rows x rows loops node
1. 17.426 17.426 ↓ 208.0 208 1

CTE Scan on child_branches (cost=962.34..968.86 rows=1 width=49) (actual time=6.910..17.426 rows=208 loops=1)

  • Filter: (is_circular AND (cid = 12975))
  • Rows Removed by Filter: 1561
2.          

CTE child_branches

3. 1.744 14.958 ↓ 6.1 1,769 1

Recursive Union (cost=0.42..962.34 rows=290 width=49) (actual time=0.051..14.958 rows=1,769 loops=1)

4. 0.830 0.830 ↓ 1.8 463 1

Index Scan using uk_gl_branches_cid_gl_tree_id_system_code on gl_branches (cost=0.42..232.34 rows=260 width=49) (actual time=0.048..0.830 rows=463 loops=1)

  • Index Cond: ((cid = 12975) AND (gl_tree_id = 2663))
  • Filter: (parent_gl_branch_id IS NOT NULL)
  • Rows Removed by Filter: 2
5. 3.895 12.384 ↓ 48.3 145 9

Nested Loop (cost=0.29..72.42 rows=3 width=49) (actual time=0.014..1.376 rows=145 loops=9)

6. 0.684 0.684 ↓ 28.8 173 9

WorkTable Scan on child_branches child (cost=0.00..58.50 rows=6 width=40) (actual time=0.001..0.076 rows=173 loops=9)

  • Filter: ((NOT is_circular) AND (cid = 12975))
  • Rows Removed by Filter: 23
7. 7.805 7.805 ↑ 1.0 1 1,561

Index Scan using idx_gl_branches_id on gl_branches parent (cost=0.29..2.31 rows=1 width=16) (actual time=0.005..0.005 rows=1 loops=1,561)

  • Index Cond: (id = child.parent_gl_branch_id)
  • Filter: ((parent_gl_branch_id IS NOT NULL) AND (cid = 12975))
  • Rows Removed by Filter: 0