explain.depesz.com

PostgreSQL's explain analyze made readable

Result: QNF

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

Finalize GroupAggregate (cost=35,455.74..35,465.36 rows=15 width=36) (actual time=349.969..359.365 rows=14 loops=1)

  • Group Key: ledger_entry.currency
2. 18.490 359.374 ↓ 1.2 36 1

Gather Merge (cost=35,455.74..35,464.95 rows=30 width=36) (actual time=349.945..359.374 rows=36 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 6.691 340.884 ↑ 1.2 12 3 / 3

Partial GroupAggregate (cost=34,455.71..34,461.46 rows=15 width=36) (actual time=331.653..340.884 rows=12 loops=3)

  • Group Key: ledger_entry.currency
4. 7.211 334.193 ↓ 38.8 10,790 3 / 3

Sort (cost=34,455.71..34,456.41 rows=278 width=10) (actual time=331.633..334.193 rows=10,790 loops=3)

  • Sort Key: ledger_entry.currency
  • Sort Method: quicksort Memory: 776kB
  • Worker 0: Sort Method: quicksort Memory: 1,589kB
  • Worker 1: Sort Method: quicksort Memory: 498kB
5. 178.152 326.982 ↓ 38.8 10,790 3 / 3

Hash Join (cost=113.07..34,444.43 rows=278 width=10) (actual time=2.371..326.982 rows=10,790 loops=3)

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

Parallel Seq Scan on ledger_entry (cost=0.00..32,426.77 rows=725,477 width=18) (actual time=0.007..148.608 rows=580,208 loops=3)

7. 0.008 0.222 ↓ 1.1 17 3 / 3

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

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

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

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

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

10. 0.037 0.037 ↓ 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.037..0.037 rows=220 loops=3)

  • Index Cond: (customer_id = 1)
11. 0.150 0.150 ↑ 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.150..0.150 rows=2,822 loops=3)

  • Index Cond: (account_group = 'CUSTOMER_PREPAID_FUNDS'::accountgroupenum)
Planning time : 0.332 ms
Execution time : 359.819 ms