explain.depesz.com

PostgreSQL's explain analyze made readable

Result: PgZE

Settings
# exclusive inclusive rows x rows loops node
1. 5.354 3,913.340 ↓ 1.4 14 1

GroupAggregate (cost=594.22..594.48 rows=10 width=41) (actual time=3,910.689..3,913.340 rows=14 loops=1)

  • Group Key: accounts.currency, dense_balance_transactions.action
2. 33.731 3,907.986 ↓ 1,792.8 23,307 1

Sort (cost=594.22..594.25 rows=13 width=17) (actual time=3,906.176..3,907.986 rows=23,307 loops=1)

  • Sort Key: accounts.currency, dense_balance_transactions.action
  • Sort Method: quicksort Memory: 1951kB
3. 10.288 3,874.255 ↓ 1,792.8 23,307 1

Nested Loop (cost=0.86..593.98 rows=13 width=17) (actual time=1.171..3,874.255 rows=23,307 loops=1)

4. 1.055 1.055 ↓ 4.0 4 1

Index Scan using index_accounts_on_user_id_and_currency on accounts (cost=0.43..2.65 rows=1 width=12) (actual time=0.395..1.055 rows=4 loops=1)

  • Index Cond: (user_id = 540512)
  • Filter: ((currency)::text <> 'FUN'::text)
5. 3,862.912 3,862.912 ↓ 6.4 5,827 4

Index Scan using index_dense_balance_transactions_on_account_id on dense_balance_transactions (cost=0.44..582.28 rows=905 width=21) (actual time=0.602..965.728 rows=5,827 loops=4)

  • Index Cond: (account_id = accounts.id)
  • Filter: ((action)::text = ANY ('{bet,win,issued_bonus,canceled_bonus}'::text[]))
  • Rows Removed by Filter: 680
Planning time : 0.605 ms
Execution time : 3,913.407 ms