explain.depesz.com

PostgreSQL's explain analyze made readable

Result: YlC9

Settings
# exclusive inclusive rows x rows loops node
1. 771.719 2,017.316 ↑ 1.0 1 1

Aggregate (cost=3,651.07..3,651.08 rows=1 width=32) (actual time=2,017.315..2,017.316 rows=1 loops=1)

2. 39.259 1,245.597 ↓ 1,348.4 106,525 1

Subquery Scan on result (cost=3,640.99..3,650.87 rows=79 width=132) (actual time=1,146.560..1,245.597 rows=106,525 loops=1)

3. 0.000 1,206.338 ↓ 1,348.4 106,525 1

Gather Merge (cost=3,640.99..3,650.08 rows=79 width=212) (actual time=1,146.550..1,206.338 rows=106,525 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
4. 78.164 2,298.584 ↓ 674.2 53,262 2

Sort (cost=2,640.98..2,641.18 rows=79 width=212) (actual time=1,141.564..1,149.292 rows=53,262 loops=2)

  • Sort Key: balance_transactions.id
  • Sort Method: quicksort Memory: 15828kB
  • Worker 0: Sort Method: quicksort Memory: 15541kB
5. 97.880 2,220.420 ↓ 674.2 53,262 2

Nested Loop Left Join (cost=3.59..2,638.49 rows=79 width=212) (actual time=33.449..1,110.210 rows=53,262 loops=2)

6. 109.336 1,909.490 ↓ 674.2 53,262 2

Nested Loop Left Join (cost=3.30..2,489.33 rows=79 width=124) (actual time=33.414..954.745 rows=53,262 loops=2)

  • Join Filter: ((balance_transactions.reference_type)::text = 'Game'::text)
  • Rows Removed by Join Filter: 256
7. 86.927 1,587.104 ↓ 674.2 53,262 2

Nested Loop Left Join (cost=2.72..2,267.54 rows=79 width=108) (actual time=33.379..793.552 rows=53,262 loops=2)

  • Join Filter: ((balance_transactions.reference_type)::text = 'BonusIssue'::text)
8. 94.641 1,393.652 ↓ 674.2 53,262 2

Nested Loop Left Join (cost=2.29..2,057.40 rows=79 width=93) (actual time=33.347..696.826 rows=53,262 loops=2)

  • Join Filter: ((balance_transactions.reference_type)::text = 'Payment'::text)
  • Rows Removed by Join Filter: 157
9. 90.768 1,192.486 ↓ 674.2 53,262 2

Nested Loop (cost=1.86..1,847.26 rows=79 width=77) (actual time=33.320..596.243 rows=53,262 loops=2)

10. 14.643 888.668 ↓ 674.2 53,262 2

Nested Loop (cost=1.44..1,692.63 rows=79 width=83) (actual time=33.278..444.334 rows=53,262 loops=2)

11. 81.213 554.450 ↓ 674.2 53,262 2

Nested Loop (cost=1.01..1,584.11 rows=79 width=75) (actual time=33.235..277.225 rows=53,262 loops=2)

12. 153.662 153.662 ↓ 657.6 53,262 2

Parallel Index Scan using index_balance_transactions_on_created_at on balance_transactions (cost=0.58..1,369.46 rows=81 width=63) (actual time=33.192..76.831 rows=53,262 loops=2)

  • Index Cond: ((created_at > '2019-07-26 09:10:09'::timestamp without time zone) AND (created_at < '2019-07-26 11:10:09'::timestamp without time zone))
  • Filter: (id >= 1659620602)
  • Rows Removed by Filter: 62238
13. 319.575 319.575 ↑ 1.0 1 106,525

Index Scan using accounts_pkey on accounts (cost=0.43..2.65 rows=1 width=20) (actual time=0.003..0.003 rows=1 loops=106,525)

  • Index Cond: (id = balance_transactions.account_id)
  • Filter: ((currency)::text <> 'FUN'::text)
14. 319.575 319.575 ↑ 1.0 1 106,525

Index Only Scan using users_pkey on users (cost=0.43..1.37 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=106,525)

  • Index Cond: (id = accounts.user_id)
  • Heap Fetches: 93201
15. 213.050 213.050 ↑ 1.0 1 106,525

Index Scan using index_profiles_on_user_id on profiles (cost=0.43..1.96 rows=1 width=10) (actual time=0.002..0.002 rows=1 loops=106,525)

  • Index Cond: (user_id = accounts.user_id)
16. 106.525 106.525 ↓ 0.0 0 106,525

Index Scan using payments_pkey on payments (cost=0.43..2.65 rows=1 width=24) (actual time=0.001..0.001 rows=0 loops=106,525)

  • Index Cond: (balance_transactions.reference_id = id)
17. 106.525 106.525 ↓ 0.0 0 106,525

Index Scan using bonus_issues_pkey on bonus_issues (cost=0.43..2.65 rows=1 width=23) (actual time=0.001..0.001 rows=0 loops=106,525)

  • Index Cond: (balance_transactions.reference_id = id)
18. 213.050 213.050 ↑ 1.0 1 106,525

Index Scan using games_pkey on games (cost=0.58..2.79 rows=1 width=24) (actual time=0.002..0.002 rows=1 loops=106,525)

  • Index Cond: (balance_transactions.reference_id = id)
19. 213.050 213.050 ↑ 1.0 1 106,525

Index Scan using game_tables_pkey on game_tables (cost=0.29..1.82 rows=1 width=16) (actual time=0.002..0.002 rows=1 loops=106,525)

  • Index Cond: (id = games.game_table_id)
Planning time : 9.655 ms
Execution time : 2,035.502 ms