explain.depesz.com

PostgreSQL's explain analyze made readable

Result: JktP

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

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

  • Group Key: ledger_entry.currency
2. 16.836 362.399 ↓ 1.2 36 1

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

  • Workers Planned: 2
  • Workers Launched: 2
3. 6.082 345.563 ↑ 1.2 12 3 / 3

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

  • Group Key: ledger_entry.currency
4. 5.645 339.481 ↓ 38.8 10,790 3 / 3

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

  • Sort Key: ledger_entry.currency
  • Sort Method: quicksort Memory: 973kB
  • Worker 0: Sort Method: quicksort Memory: 476kB
  • Worker 1: Sort Method: quicksort Memory: 1,029kB
5. 194.392 333.836 ↓ 38.8 10,790 3 / 3

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

  • Hash Cond: (ledger_entry.account_id = billing_account.id)
6. 139.233 139.233 ↑ 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..139.233 rows=580,202 loops=3)

7. 0.007 0.211 ↓ 1.1 17 3 / 3

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

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

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

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

BitmapAnd (cost=59.68..59.68 rows=15 width=0) (actual time=0.185..0.185 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.145 0.145 ↑ 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.145..0.145 rows=2,822 loops=3)

  • Index Cond: (account_group = 'CUSTOMER_PREPAID_FUNDS'::accountgroupenum)
Planning time : 0.330 ms
Execution time : 362.942 ms