explain.depesz.com

PostgreSQL's explain analyze made readable

Result: BEwS

Settings
# exclusive inclusive rows x rows loops node
1. 0.026 2.323 ↑ 14.4 48 1

HashAggregate (cost=5,407.11..5,414.04 rows=693 width=68) (actual time=2.314..2.323 rows=48 loops=1)

  • Group Key: subtree_5down.id, subtree_5down.svmxc__parent__c, subtree_5down.level
2.          

CTE ancestors

3. 0.008 0.044 ↑ 25.2 8 1

Recursive Union (cost=0.29..1,442.46 rows=202 width=12) (actual time=0.016..0.044 rows=8 loops=1)

4. 0.016 0.016 ↑ 1.0 2 1

Index Scan using pk_site on svmxc__site__c (cost=0.29..13.91 rows=2 width=12) (actual time=0.014..0.016 rows=2 loops=1)

  • Index Cond: (id = ANY ('{"100 D","101 D"}'::text[]))
5. 0.004 0.020 ↑ 10.0 2 4

Nested Loop (cost=0.29..142.45 rows=20 width=12) (actual time=0.004..0.005 rows=2 loops=4)

6. 0.000 0.000 ↑ 10.0 2 4

WorkTable Scan on ancestors a (cost=0.00..0.40 rows=20 width=32) (actual time=0.000..0.000 rows=2 loops=4)

7. 0.016 0.016 ↑ 1.0 1 8

Index Scan using pk_site on svmxc__site__c site (cost=0.29..7.10 rows=1 width=12) (actual time=0.002..0.002 rows=1 loops=8)

  • Index Cond: (id = a.svmxc__parent__c)
8.          

CTE subtree_5down

9. 0.020 2.282 ↑ 144.4 48 1

Recursive Union (cost=0.00..3,774.02 rows=6,932 width=68) (actual time=0.018..2.282 rows=48 loops=1)

10. 0.048 0.048 ↑ 25.2 8 1

CTE Scan on ancestors (cost=0.00..4.04 rows=202 width=68) (actual time=0.017..0.048 rows=8 loops=1)

11. 0.027 2.214 ↑ 96.1 7 6

Hash Join (cost=306.75..363.13 rows=673 width=16) (actual time=0.368..0.369 rows=7 loops=6)

  • Hash Cond: (s.id = site_1.svmxc__parent__c)
12. 0.006 0.006 ↑ 96.1 7 6

WorkTable Scan on subtree_5down s (cost=0.00..45.45 rows=673 width=36) (actual time=0.000..0.001 rows=7 loops=6)

  • Filter: (level < 5)
  • Rows Removed by Filter: 1
13. 1.403 2.181 ↑ 1.1 10,010 1

Hash (cost=169.11..169.11 rows=11,011 width=12) (actual time=2.181..2.181 rows=10,010 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 559kB
14. 0.778 0.778 ↑ 1.0 11,011 1

Seq Scan on svmxc__site__c site_1 (cost=0.00..169.11 rows=11,011 width=12) (actual time=0.006..0.778 rows=11,011 loops=1)

15. 2.297 2.297 ↑ 144.4 48 1

CTE Scan on subtree_5down (cost=0.00..138.64 rows=6,932 width=68) (actual time=0.018..2.297 rows=48 loops=1)

Planning time : 0.349 ms