explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 3i6h

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 14.925 ↓ 0.0 0 1

Nested Loop (cost=255.90..1,334.76 rows=2 width=8) (actual time=14.925..14.925 rows=0 loops=1)

  • Join Filter: CASE WHEN (d.id IS NULL) THEN (b.move = e.id) ELSE (d.move = e.id) END
2.          

CTE current_move

3. 0.019 11.914 ↑ 57.5 2 1

Hash Join (cost=4.93..253.20 rows=115 width=12) (actual time=10.774..11.914 rows=2 loops=1)

  • Hash Cond: (am.period = p.id)
4. 0.005 11.853 ↑ 57.5 2 1

Nested Loop (cost=1.14..247.82 rows=115 width=16) (actual time=10.715..11.853 rows=2 loops=1)

5. 3.942 3.942 ↑ 1.0 1 1

Index Scan using account_move_pkey on account_move am (cost=0.56..8.58 rows=1 width=8) (actual time=3.942..3.942 rows=1 loops=1)

  • Index Cond: (id = 18,378,423)
6. 7.906 7.906 ↑ 57.5 2 1

Index Scan using account_move_line_move_index on account_move_line aml (cost=0.57..238.09 rows=115 width=12) (actual time=6.770..7.906 rows=2 loops=1)

  • Index Cond: (move = 18,378,423)
7. 0.010 0.042 ↑ 1.0 80 1

Hash (cost=2.80..2.80 rows=80 width=4) (actual time=0.042..0.042 rows=80 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 11kB
8. 0.032 0.032 ↑ 1.0 80 1

Seq Scan on account_period p (cost=0.00..2.80 rows=80 width=4) (actual time=0.020..0.032 rows=80 loops=1)

9. 0.006 0.023 ↑ 1.0 1 1

Nested Loop (cost=1.00..17.05 rows=1 width=8) (actual time=0.023..0.023 rows=1 loops=1)

10. 0.011 0.011 ↑ 1.0 1 1

Index Scan using account_invoice_pkey on account_invoice f (cost=0.44..8.46 rows=1 width=8) (actual time=0.011..0.011 rows=1 loops=1)

  • Index Cond: (id = 18,378,423)
11. 0.006 0.006 ↑ 1.0 1 1

Index Only Scan using account_move_pkey on account_move e (cost=0.56..8.58 rows=1 width=4) (actual time=0.006..0.006 rows=1 loops=1)

  • Index Cond: (id = f.move)
  • Heap Fetches: 1
12. 0.000 14.900 ↓ 0.0 0 1

Nested Loop (cost=1.70..1,064.46 rows=4 width=16) (actual time=14.900..14.900 rows=0 loops=1)

  • Join Filter: (d.move <> b.move)
13. 0.000 14.900 ↓ 0.0 0 1

Nested Loop (cost=1.13..998.31 rows=1 width=12) (actual time=14.900..14.900 rows=0 loops=1)

  • Join Filter: (b.id = a.line)
14. 0.002 14.900 ↓ 0.0 0 1

Nested Loop (cost=0.56..990.44 rows=1 width=16) (actual time=14.900..14.900 rows=0 loops=1)

15. 11.918 11.918 ↑ 57.5 2 1

CTE Scan on current_move b (cost=0.00..2.30 rows=115 width=8) (actual time=10.776..11.918 rows=2 loops=1)

16. 2.980 2.980 ↓ 0.0 0 2

Index Scan using account_move_reconciliation_delegate_to_index on account_move_reconciliation c (cost=0.56..8.58 rows=1 width=8) (actual time=1.490..1.490 rows=0 loops=2)

  • Index Cond: (delegate_to = b.id)
17. 0.000 0.000 ↓ 0.0 0

Index Scan using account_payment_line_index on account_payment a (cost=0.56..7.86 rows=1 width=8) (never executed)

  • Index Cond: (line = c.delegate_to)
18. 0.000 0.000 ↓ 0.0 0

Index Scan using account_move_line_reconciliation_index on account_move_line d (cost=0.57..65.79 rows=29 width=12) (never executed)

  • Index Cond: (reconciliation = c.id)
Planning time : 1.848 ms
Execution time : 15.121 ms