explain.depesz.com

PostgreSQL's explain analyze made readable

Result: WtIU

Settings
# exclusive inclusive rows x rows loops node
1. 59.551 4,629.994 ↑ 1.0 1 1

Aggregate (cost=643,792.17..643,792.18 rows=1 width=8) (actual time=4,629.994..4,629.994 rows=1 loops=1)

2. 83.429 4,570.443 ↑ 7.4 538,952 1

Hash Join (cost=1,175.30..633,866.34 rows=3,970,329 width=4) (actual time=3,033.275..4,570.443 rows=538,952 loops=1)

  • Hash Cond: (line.statement_id = st.id)
3. 1,154.948 4,482.244 ↑ 7.4 538,952 1

Merge Anti Join (cost=1.00..622,265.88 rows=3,970,329 width=8) (actual time=3,028.453..4,482.244 rows=538,952 loops=1)

  • Merge Cond: (line.id = aml.statement_line_id)
4. 1,427.312 1,427.312 ↓ 1.0 4,223,467 1

Index Scan using account_bank_statement_line_pkey on account_bank_statement_line line (cost=0.43..172,628.04 rows=4,222,878 width=8) (actual time=0.009..1,427.312 rows=4,223,467 loops=1)

  • Filter: (amount <> 0.0)
  • Rows Removed by Filter: 144
5. 1,899.984 1,899.984 ↑ 4.6 7,369,313 1

Index Only Scan using account_move_line_statement_line_id_index on account_move_line aml (cost=0.56..1,641,006.98 rows=33,688,478 width=4) (actual time=0.026..1,899.984 rows=7,369,313 loops=1)

  • Heap Fetches: 7,369,347
6. 1.377 4.770 ↑ 1.0 10,920 1

Hash (cost=1,037.80..1,037.80 rows=10,920 width=4) (actual time=4.770..4.770 rows=10,920 loops=1)

  • Buckets: 16,384 Batches: 1 Memory Usage: 512kB
7. 3.393 3.393 ↑ 1.0 10,920 1

Seq Scan on account_bank_statement st (cost=0.00..1,037.80 rows=10,920 width=4) (actual time=0.012..3.393 rows=10,920 loops=1)

  • Filter: ((journal_id = 17) AND ((state)::text = 'open'::text))
Planning time : 0.826 ms
Execution time : 4,630.058 ms