explain.depesz.com

PostgreSQL's explain analyze made readable

Result: OFwN

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 411.563 ↑ 1.1 14 1

Finalize GroupAggregate (cost=35,454.37..35,464.00 rows=15 width=36) (actual time=402.979..411.563 rows=14 loops=1)

  • Group Key: ledger_entry.currency
2. 19.096 411.573 ↓ 1.2 36 1

Gather Merge (cost=35,454.37..35,463.58 rows=30 width=36) (actual time=402.953..411.573 rows=36 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 5.460 392.477 ↑ 1.2 12 3 / 3

Partial GroupAggregate (cost=34,454.35..34,460.10 rows=15 width=36) (actual time=386.066..392.477 rows=12 loops=3)

  • Group Key: ledger_entry.currency
4. 6.582 387.017 ↓ 38.8 10,790 3 / 3

Sort (cost=34,454.35..34,455.04 rows=278 width=10) (actual time=386.047..387.017 rows=10,790 loops=3)

  • Sort Key: ledger_entry.currency
  • Sort Method: quicksort Memory: 971kB
  • Worker 0: Sort Method: quicksort Memory: 566kB
  • Worker 1: Sort Method: quicksort Memory: 942kB
5. 213.874 380.435 ↓ 38.8 10,790 3 / 3

Hash Join (cost=113.07..34,443.06 rows=278 width=10) (actual time=0.730..380.435 rows=10,790 loops=3)

  • Hash Cond: (ledger_entry.account_id = billing_account.id)
6. 166.370 166.370 ↑ 1.3 580,202 3 / 3

Parallel Seq Scan on ledger_entry (cost=0.00..32,425.48 rows=725,448 width=18) (actual time=0.007..166.370 rows=580,202 loops=3)

7. 0.007 0.191 ↓ 1.1 17 3 / 3

Hash (cost=112.89..112.89 rows=15 width=8) (actual time=0.190..0.191 rows=17 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
8. 0.016 0.184 ↓ 1.1 17 3 / 3

Bitmap Heap Scan on billing_account (cost=59.68..112.89 rows=15 width=8) (actual time=0.176..0.184 rows=17 loops=3)

  • Recheck Cond: ((customer_id = 1) AND (account_group = 'CUSTOMER_PREPAID_FUNDS'::accountgroupenum))
  • Heap Blocks: exact=7
9. 0.007 0.168 ↓ 0.0 0 3 / 3

BitmapAnd (cost=59.68..59.68 rows=15 width=0) (actual time=0.168..0.168 rows=0 loops=3)

10. 0.032 0.032 ↓ 1.1 220 3 / 3

Bitmap Index Scan on billing_account_customer_id_idx (cost=0.00..5.83 rows=206 width=0) (actual time=0.032..0.032 rows=220 loops=3)

  • Index Cond: (customer_id = 1)
11. 0.129 0.129 ↑ 1.0 2,822 3 / 3

Bitmap Index Scan on billing_account_account_group_idx (cost=0.00..53.59 rows=2,840 width=0) (actual time=0.129..0.129 rows=2,822 loops=3)

  • Index Cond: (account_group = 'CUSTOMER_PREPAID_FUNDS'::accountgroupenum)
Planning time : 0.351 ms
Execution time : 412.058 ms