explain.depesz.com

PostgreSQL's explain analyze made readable

Result: U4bA

Settings
# exclusive inclusive rows x rows loops node
1. 14.919 54.539 ↓ 17.0 17 1

HashAggregate (cost=5,937.65..5,937.66 rows=1 width=36) (actual time=54.533..54.539 rows=17 loops=1)

  • Group Key: ba.currency
2.          

CTE ba

3. 0.014 0.130 ↓ 1.1 17 1

Bitmap Heap Scan on billing_account (cost=59.46..112.63 rows=15 width=120) (actual time=0.124..0.130 rows=17 loops=1)

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

BitmapAnd (cost=59.46..59.46 rows=15 width=0) (actual time=0.116..0.116 rows=0 loops=1)

5. 0.021 0.021 ↓ 1.1 228 1

Bitmap Index Scan on billing_account_customer_id_idx (cost=0.00..5.82 rows=204 width=0) (actual time=0.021..0.021 rows=228 loops=1)

  • Index Cond: (customer_id = 175)
6. 0.088 0.088 ↑ 1.0 2,788 1

Bitmap Index Scan on billing_account_account_group_idx (cost=0.00..53.39 rows=2,813 width=0) (actual time=0.088..0.088 rows=2,788 loops=1)

  • Index Cond: (account_group = 'CUSTOMER_PREPAID_FUNDS'::accountgroupenum)
7. 12.582 39.620 ↓ 43.0 79,798 1

Nested Loop (cost=38.82..5,811.09 rows=1,857 width=10) (actual time=0.145..39.620 rows=79,798 loops=1)

8. 0.144 0.144 ↓ 17.0 17 1

CTE Scan on ba (cost=0.00..0.34 rows=1 width=12) (actual time=0.127..0.144 rows=17 loops=1)

  • Filter: (customer_id = 175)
9. 22.797 26.894 ↓ 2.5 4,694 17

Bitmap Heap Scan on ledger_entry (cost=38.82..5,792.18 rows=1,857 width=14) (actual time=0.356..1.582 rows=4,694 loops=17)

  • Recheck Cond: (account_id = ba.id)
  • Heap Blocks: exact=12,530
10. 4.097 4.097 ↓ 2.5 4,694 17

Bitmap Index Scan on ix_ledger_entry_account_id (cost=0.00..38.36 rows=1,857 width=0) (actual time=0.241..0.241 rows=4,694 loops=17)

  • Index Cond: (account_id = ba.id)
Planning time : 0.167 ms
Execution time : 54.608 ms