explain.depesz.com

PostgreSQL's explain analyze made readable

Result: HkrY

Settings
# exclusive inclusive rows x rows loops node
1. 0.041 0.126 ↑ 33.7 3 1

Hash Left Join (cost=157.37..160.78 rows=101 width=1,664) (actual time=0.123..0.126 rows=3 loops=1)

  • Hash Cond: (accounts_children.id = balance.id)
2.          

CTE accounts_children

3. 0.004 0.029 ↑ 33.7 3 1

Recursive Union (cost=0.00..122.27 rows=101 width=1,616) (actual time=0.004..0.029 rows=3 loops=1)

4. 0.005 0.005 ↓ 2.0 2 1

Seq Scan on "Accounts" (cost=0.00..10.50 rows=1 width=1,616) (actual time=0.004..0.005 rows=2 loops=1)

  • Filter: (depth = 0)
  • Rows Removed by Filter: 1
5. 0.012 0.020 ↓ 0.0 0 2

Hash Join (cost=0.33..10.97 rows=10 width=1,616) (actual time=0.009..0.010 rows=0 loops=2)

  • Hash Cond: (ac.parent = accounts_children_1.id)
6. 0.004 0.004 ↑ 13.3 3 2

Seq Scan on "Accounts" ac (cost=0.00..10.40 rows=40 width=1,616) (actual time=0.001..0.002 rows=3 loops=2)

7. 0.002 0.004 ↑ 5.0 2 2

Hash (cost=0.20..0.20 rows=10 width=16) (actual time=0.002..0.002 rows=2 loops=2)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
8. 0.002 0.002 ↑ 5.0 2 2

WorkTable Scan on accounts_children accounts_children_1 (cost=0.00..0.20 rows=10 width=16) (actual time=0.001..0.001 rows=2 loops=2)

9.          

CTE balance

10. 0.007 0.057 ↑ 33.7 3 1

HashAggregate (cost=30.55..31.82 rows=101 width=48) (actual time=0.056..0.057 rows=3 loops=1)

  • Group Key: accounts_children_2.id
11. 0.018 0.050 ↑ 29.2 14 1

Hash Right Join (cost=3.28..28.51 rows=409 width=24) (actual time=0.044..0.050 rows=14 loops=1)

  • Hash Cond: (s.account = accounts_children_2.id)
12. 0.004 0.004 ↑ 62.3 13 1

Seq Scan on "Splits" s (cost=0.00..18.10 rows=810 width=24) (actual time=0.003..0.004 rows=13 loops=1)

13. 0.002 0.028 ↑ 33.7 3 1

Hash (cost=2.02..2.02 rows=101 width=16) (actual time=0.028..0.028 rows=3 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
14. 0.026 0.026 ↑ 33.7 3 1

CTE Scan on accounts_children accounts_children_2 (cost=0.00..2.02 rows=101 width=16) (actual time=0.001..0.026 rows=3 loops=1)

15. 0.005 0.005 ↑ 33.7 3 1

CTE Scan on accounts_children (cost=0.00..2.02 rows=101 width=1,616) (actual time=0.005..0.005 rows=3 loops=1)

16. 0.021 0.080 ↑ 33.7 3 1

Hash (cost=2.02..2.02 rows=101 width=48) (actual time=0.080..0.080 rows=3 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
17. 0.059 0.059 ↑ 33.7 3 1

CTE Scan on balance (cost=0.00..2.02 rows=101 width=48) (actual time=0.057..0.059 rows=3 loops=1)

Planning time : 0.377 ms
Execution time : 0.223 ms