explain.depesz.com

PostgreSQL's explain analyze made readable

Result: JNIX : Optimization for: transactions; plan #rZdw

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 2,666.426 3,678.619 ↑ 1.0 2,786,124 1

Sort (cost=480,872.27..487,837.58 rows=2,786,124 width=17) (actual time=3,044.257..3,678.619 rows=2,786,124 loops=1)

  • Sort Key: transactions.id
  • Sort Method: external merge Disk: 73568kB
2. 560.142 1,012.193 ↑ 1.0 2,786,124 1

Hash Left Join (cost=13,766.90..68,345.09 rows=2,786,124 width=17) (actual time=258.098..1,012.193 rows=2,786,124 loops=1)

  • Hash Cond: (transactions.account_id = accounts_transactions.id)
3. 123.701 258.729 ↑ 1.0 464,354 1

Hash Join (cost=1,457.50..17,149.91 rows=464,354 width=20) (actual time=64.040..258.729 rows=464,354 loops=1)

  • Hash Cond: (transactions.account_id = imported_accounts.id)
4. 117.022 117.022 ↑ 1.0 464,354 1

Seq Scan on transactions (cost=0.00..9,307.54 rows=464,354 width=20) (actual time=45.697..117.022 rows=464,354 loops=1)

5. 9.218 18.006 ↑ 1.0 40,060 1

Hash (cost=956.75..956.75 rows=40,060 width=4) (actual time=18.006..18.006 rows=40,060 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 1921kB
6. 8.788 8.788 ↑ 1.0 40,060 1

Seq Scan on imported_accounts (cost=0.00..956.75 rows=40,060 width=4) (actual time=0.016..8.788 rows=40,060 loops=1)

  • Filter: (budget_lea_id = 15)
7. 68.390 193.322 ↑ 1.0 240,360 1

Hash (cost=8,365.90..8,365.90 rows=240,360 width=4) (actual time=193.322..193.322 rows=240,360 loops=1)

  • Buckets: 131072 Batches: 4 Memory Usage: 3153kB
8. 88.106 124.932 ↑ 1.0 240,360 1

Hash Right Join (cost=1,357.35..8,365.90 rows=240,360 width=4) (actual time=14.532..124.932 rows=240,360 loops=1)

  • Hash Cond: (imported_account_segments.account_id = accounts_transactions.id)
9. 22.596 22.596 ↑ 1.0 240,360 1

Seq Scan on imported_account_segments (cost=0.00..3,703.60 rows=240,360 width=4) (actual time=0.013..22.596 rows=240,360 loops=1)

10. 8.348 14.230 ↑ 1.0 40,060 1

Hash (cost=856.60..856.60 rows=40,060 width=4) (actual time=14.230..14.230 rows=40,060 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 1921kB
11. 5.882 5.882 ↑ 1.0 40,060 1

Seq Scan on imported_accounts accounts_transactions (cost=0.00..856.60 rows=40,060 width=4) (actual time=0.012..5.882 rows=40,060 loops=1)

Planning time : 0.412 ms
Execution time : 3,822.305 ms