explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 2Vk7

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.000 277.698 ↓ 1.4 14 1

Finalize GroupAggregate (cost=56,267.39..56,273.49 rows=10 width=36) (actual time=272.278..277.698 rows=14 loops=1)

  • Group Key: billing_account.currency
2. 9.960 277.719 ↓ 1.8 35 1

Gather Merge (cost=56,267.39..56,273.22 rows=20 width=36) (actual time=272.258..277.719 rows=35 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 1.926 267.759 ↓ 1.2 12 3 / 3

Partial GroupAggregate (cost=55,267.36..55,270.89 rows=10 width=36) (actual time=265.113..267.759 rows=12 loops=3)

  • Group Key: billing_account.currency
4. 3.171 265.833 ↓ 31.7 10,773 3 / 3

Sort (cost=55,267.36..55,268.21 rows=340 width=10) (actual time=265.095..265.833 rows=10,773 loops=3)

  • Sort Key: billing_account.currency
  • Sort Method: quicksort Memory: 941kB
  • Worker 0: Sort Method: quicksort Memory: 460kB
  • Worker 1: Sort Method: quicksort Memory: 1,075kB
5. 141.095 262.662 ↓ 31.7 10,773 3 / 3

Hash Join (cost=121.14..55,253.07 rows=340 width=10) (actual time=0.279..262.662 rows=10,773 loops=3)

  • Hash Cond: (ledger_entry.account_id = billing_account.id)
6. 121.375 121.375 ↑ 1.3 892,745 3 / 3

Parallel Seq Scan on ledger_entry (cost=0.00..52,178.84 rows=1,124,884 width=14) (actual time=0.007..121.375 rows=892,745 loops=3)

7. 0.007 0.192 ↓ 1.2 17 3 / 3

Hash (cost=120.96..120.96 rows=14 width=12) (actual time=0.191..0.192 rows=17 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
8. 0.015 0.185 ↓ 1.2 17 3 / 3

Bitmap Heap Scan on billing_account (cost=70.19..120.96 rows=14 width=12) (actual time=0.177..0.185 rows=17 loops=3)

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

BitmapAnd (cost=70.19..70.19 rows=14 width=0) (actual time=0.170..0.170 rows=0 loops=3)

10. 0.027 0.027 ↓ 1.1 220 3 / 3

Bitmap Index Scan on billing_account_customer_id_idx (cost=0.00..5.86 rows=209 width=0) (actual time=0.026..0.027 rows=220 loops=3)

  • Index Cond: (customer_id = 1)
11. 0.133 0.133 ↑ 1.0 3,128 3 / 3

Bitmap Index Scan on billing_account_account_group_idx (cost=0.00..64.07 rows=3,171 width=0) (actual time=0.133..0.133 rows=3,128 loops=3)

  • Index Cond: (account_group = 'CUSTOMER_PREPAID_FUNDS'::accountgroupenum)
Planning time : 0.303 ms
Execution time : 278.118 ms