explain.depesz.com

PostgreSQL's explain analyze made readable

Result: AtbB

Settings
# exclusive inclusive rows x rows loops node
1. 0.427 1,012.886 ↓ 2.8 14 1

Hash Join (cost=51,492.85..51,810.85 rows=5 width=36) (actual time=1,010.038..1,012.886 rows=14 loops=1)

  • Hash Cond: (x.acc_id = billing_account.id)
2.          

CTE x

3. 9.594 1,011.184 ↑ 3.4 4,128 1

Finalize HashAggregate (cost=51,204.09..51,379.78 rows=14,055 width=44) (actual time=1,009.827..1,011.184 rows=4,128 loops=1)

  • Group Key: ledger_entry.currency, ledger_entry.account_id
4. 17.604 1,001.590 ↑ 4.0 6,983 1

Gather (cost=47,936.31..50,922.99 rows=28,110 width=44) (actual time=995.514..1,001.590 rows=6,983 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
5. 787.307 983.986 ↑ 6.0 2,328 3 / 3

Partial HashAggregate (cost=46,936.31..47,111.99 rows=14,055 width=44) (actual time=981.909..983.986 rows=2,328 loops=3)

  • Group Key: ledger_entry.currency, ledger_entry.account_id
6. 196.679 196.679 ↑ 1.3 580,213 3 / 3

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

7. 1,012.317 1,012.317 ↑ 3.4 4,128 1

CTE Scan on x (cost=0.00..281.10 rows=14,055 width=44) (actual time=1,009.832..1,012.317 rows=4,128 loops=1)

8. 0.006 0.142 ↓ 1.1 17 1

Hash (cost=112.89..112.89 rows=15 width=8) (actual time=0.142..0.142 rows=17 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
9. 0.014 0.136 ↓ 1.1 17 1

Bitmap Heap Scan on billing_account (cost=59.68..112.89 rows=15 width=8) (actual time=0.129..0.136 rows=17 loops=1)

  • Recheck Cond: ((customer_id = 1) AND (account_group = 'CUSTOMER_PREPAID_FUNDS'::accountgroupenum))
  • Heap Blocks: exact=7
10. 0.007 0.122 ↓ 0.0 0 1

BitmapAnd (cost=59.68..59.68 rows=15 width=0) (actual time=0.122..0.122 rows=0 loops=1)

11. 0.023 0.023 ↓ 1.1 220 1

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

  • Index Cond: (customer_id = 1)
12. 0.092 0.092 ↑ 1.0 2,822 1

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

  • Index Cond: (account_group = 'CUSTOMER_PREPAID_FUNDS'::accountgroupenum)
Planning time : 0.193 ms
Execution time : 1,013.772 ms