explain.depesz.com

PostgreSQL's explain analyze made readable

Result: hIVL

Settings
# exclusive inclusive rows x rows loops node
1. 0.233 132.802 ↓ 16.7 100 1

Limit (cost=2,022.93..2,022.95 rows=6 width=542) (actual time=132.465..132.802 rows=100 loops=1)

2. 2.005 132.569 ↓ 16.7 100 1

Sort (cost=2,022.93..2,022.95 rows=6 width=542) (actual time=132.460..132.569 rows=100 loops=1)

  • Sort Key: f0."timestamp" DESC
  • Sort Method: top-N heapsort Memory: 128kB
3. 0.973 130.564 ↓ 49.0 294 1

Nested Loop (cost=948.28..2,022.85 rows=6 width=542) (actual time=56.893..130.564 rows=294 loops=1)

4. 0.043 0.043 ↑ 1.0 1 1

Index Scan using fin_accounts_pkey on fin_accounts f3 (cost=0.28..8.29 rows=1 width=60) (actual time=0.036..0.043 rows=1 loops=1)

  • Index Cond: (id = 1093)
5. 2.443 129.548 ↓ 49.0 294 1

Nested Loop (cost=948.01..2,014.50 rows=6 width=482) (actual time=56.845..129.548 rows=294 loops=1)

  • Join Filter: (f1.fin_journal_entry_id = f0.id)
6. 1.847 122.989 ↓ 1.1 294 1

Hash Join (cost=947.72..1,924.47 rows=258 width=435) (actual time=56.782..122.989 rows=294 loops=1)

  • Hash Cond: (f2.fin_account_id = f4.id)
7. 53.573 113.600 ↓ 1.1 588 1

Hash Join (cost=889.29..1,862.54 rows=522 width=282) (actual time=49.217..113.600 rows=588 loops=1)

  • Hash Cond: (f2.fin_journal_entry_id = f1.fin_journal_entry_id)
8. 41.547 41.547 ↑ 1.0 33,002 1

Seq Scan on fin_transactions f2 (cost=0.00..803.02 rows=33,002 width=141) (actual time=0.029..41.547 rows=33,002 loops=1)

9. 0.727 18.480 ↑ 1.0 294 1

Hash (cost=885.53..885.53 rows=301 width=141) (actual time=18.478..18.480 rows=294 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 31kB
10. 17.753 17.753 ↑ 1.0 294 1

Seq Scan on fin_transactions f1 (cost=0.00..885.53 rows=301 width=141) (actual time=5.713..17.753 rows=294 loops=1)

  • Filter: (fin_account_id = 1093)
  • Rows Removed by Filter: 32708
11. 0.024 7.542 ↑ 103.5 4 1

Hash (cost=53.26..53.26 rows=414 width=153) (actual time=7.540..7.542 rows=4 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
12. 2.311 7.518 ↑ 103.5 4 1

Hash Left Join (cost=32.63..53.26 rows=414 width=153) (actual time=4.973..7.518 rows=4 loops=1)

  • Hash Cond: (f4.unit_id = u5.id)
  • Filter: CASE f4.type WHEN 'unit'::text THEN (u5.site_id = ANY ('{299}'::integer[])) ELSE false END
  • Rows Removed by Filter: 824
13. 1.950 1.950 ↑ 1.0 828 1

Seq Scan on fin_accounts f4 (cost=0.00..18.44 rows=828 width=60) (actual time=0.045..1.950 rows=828 loops=1)

  • Filter: ((type)::text = ANY ('{unit}'::text[]))
  • Rows Removed by Filter: 11
14. 1.684 3.257 ↑ 1.0 828 1

Hash (cost=22.28..22.28 rows=828 width=93) (actual time=3.255..3.257 rows=828 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 112kB
15. 1.573 1.573 ↑ 1.0 828 1

Seq Scan on units u5 (cost=0.00..22.28 rows=828 width=93) (actual time=0.020..1.573 rows=828 loops=1)

16. 4.116 4.116 ↑ 1.0 1 294

Index Scan using fin_journal_pkey on fin_journal f0 (cost=0.29..0.34 rows=1 width=47) (actual time=0.014..0.014 rows=1 loops=294)

  • Index Cond: (id = f2.fin_journal_entry_id)
  • Filter: ((type)::text = ANY ('{load_funds,unload_funds}'::text[]))
Planning time : 5.005 ms
Execution time : 133.223 ms