explain.depesz.com

PostgreSQL's explain analyze made readable

Result: wwjP

Settings
# exclusive inclusive rows x rows loops node
1. 11.913 365.849 ↑ 1.1 14 1

HashAggregate (cost=49,992.61..49,992.80 rows=15 width=36) (actual time=365.842..365.849 rows=14 loops=1)

  • Group Key: ledger_entry.currency
2.          

CTE x

3. 0.013 0.126 ↓ 1.1 17 1

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

  • Recheck Cond: ((customer_id = 1) AND (account_group = 'CUSTOMER_PREPAID_FUNDS'::accountgroupenum))
  • Heap Blocks: exact=7
4. 0.006 0.113 ↓ 0.0 0 1

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

5. 0.019 0.019 ↓ 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.019..0.019 rows=220 loops=1)

  • Index Cond: (customer_id = 1)
6. 0.088 0.088 ↑ 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.088..0.088 rows=2,822 loops=1)

  • Index Cond: (account_group = 'CUSTOMER_PREPAID_FUNDS'::accountgroupenum)
7. 181.419 353.936 ↓ 1.2 32,371 1

Hash Join (cost=0.49..49,391.95 rows=27,873 width=10) (actual time=0.151..353.936 rows=32,371 loops=1)

  • Hash Cond: (ledger_entry.account_id = x.acc_id)
8. 172.380 172.380 ↑ 1.0 1,740,639 1

Seq Scan on ledger_entry (cost=0.00..42,583.44 rows=1,741,144 width=18) (actual time=0.006..172.380 rows=1,740,639 loops=1)

9. 0.005 0.137 ↓ 1.1 17 1

Hash (cost=0.30..0.30 rows=15 width=8) (actual time=0.136..0.137 rows=17 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
10. 0.132 0.132 ↓ 1.1 17 1

CTE Scan on x (cost=0.00..0.30 rows=15 width=8) (actual time=0.122..0.132 rows=17 loops=1)

Planning time : 0.152 ms
Execution time : 366.091 ms