explain.depesz.com

PostgreSQL's explain analyze made readable

Result: SI2O

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=3,068.29..9,611.97 rows=36 width=36) (actual rows= loops=)

  • Group Key: accounts.currency
2. 0.000 0.000 ↓ 0.0

Sort (cost=3,068.29..3,068.53 rows=96 width=29) (actual rows= loops=)

  • Sort Key: accounts.currency
3. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=1,882.49..3,065.13 rows=96 width=29) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,882.21..2,616.27 rows=96 width=29) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Hash Join (cost=1,881.92..2,466.11 rows=96 width=33) (actual rows= loops=)

  • Hash Cond: (bonus_issues.id = balance_transactions.reference_id)
6. 0.000 0.000 ↓ 0.0

Seq Scan on bonus_issues (cost=0.00..582.61 rows=193 width=33) (actual rows= loops=)

  • Filter: (((stage)::text = ANY ('{wait,handle_bets}'::text[])) OR (((stage)::text <> 'issued'::text) AND (updated_at >= '2020-08-11 12:57:48'::timestamp
7. 0.000 0.000 ↓ 0.0

Hash (cost=1,879.42..1,879.42 rows=200 width=8) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

HashAggregate (cost=1,877.42..1,879.42 rows=200 width=8) (actual rows= loops=)

  • Group Key: balance_transactions.reference_id
9. 0.000 0.000 ↓ 0.0

Append (cost=366.53..1,853.50 rows=9,570 width=8) (actual rows= loops=)

  • -> Index Scan using casino_balance_transactions_2_reference_type_reference_id_idx30 on casino_balance_transactions_2020_w32 (cost=0.14..8.
  • -> Index Scan using casino_balance_transactions_2_reference_type_reference_id_idx31 on casino_balance_transactions_2020_w33 (cost=0.14..8.
10. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on balance_transactions (cost=366.53..1,366.38 rows=5,842 width=8) (actual rows= loops=)

  • Recheck Cond: ((reference_type)::text = 'BonusIssue'::text)
  • Filter: ((amount_cents > 0) AND (created_at < '2020-08-11 12:57:48'::timestamp without time zone))
11. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on index_balance_transactions_on_reference_type_and_reference_id (cost=0.00..365.06 rows=15,020 width=0) (actual rows= loops=)

  • Index Cond: ((reference_type)::text = 'BonusIssue'::text)
12. 0.000 0.000 ↓ 0.0

Seq Scan on casino_balance_transactions_2020_w02 (cost=0.00..4.47 rows=10 width=8) (actual rows= loops=)

  • Filter: ((amount_cents > 0) AND (created_at < '2020-08-11 12:57:48'::timestamp without time zone) AND ((reference_type)::text = 'Bonus
13. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on casino_balance_transactions_2020_w03 (cost=4.98..19.59 rows=34 width=8) (actual rows= loops=)

  • Recheck Cond: ((reference_type)::text = 'BonusIssue'::text)
  • Filter: ((amount_cents > 0) AND (created_at < '2020-08-11 12:57:48'::timestamp without time zone))
14. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on casino_balance_transactions_20_reference_type_reference_id_idx1 (cost=0.00..4.97 rows=92 width=0) (actual rows= loops=)

  • Index Cond: ((reference_type)::text = 'BonusIssue'::text)
15. 0.000 0.000 ↓ 0.0

Seq Scan on casino_balance_transactions_2020_w04 (cost=0.00..4.84 rows=22 width=8) (actual rows= loops=)

  • Filter: ((amount_cents > 0) AND (created_at < '2020-08-11 12:57:48'::timestamp without time zone) AND ((reference_type)::text = 'Bonus
16. 0.000 0.000 ↓ 0.0

Seq Scan on casino_balance_transactions_2020_w05 (cost=0.00..8.87 rows=32 width=8) (actual rows= loops=)

  • Filter: ((amount_cents > 0) AND (created_at < '2020-08-11 12:57:48'::timestamp without time zone) AND ((reference_type)::text = 'Bonus
17. 0.000 0.000 ↓ 0.0

Seq Scan on casino_balance_transactions_2020_w06 (cost=0.00..6.61 rows=13 width=8) (actual rows= loops=)

  • Filter: ((amount_cents > 0) AND (created_at < '2020-08-11 12:57:48'::timestamp without time zone) AND ((reference_type)::text = 'Bonus
18. 0.000 0.000 ↓ 0.0

Seq Scan on casino_balance_transactions_2020_w07 (cost=0.00..6.68 rows=54 width=8) (actual rows= loops=)

  • Filter: ((amount_cents > 0) AND (created_at < '2020-08-11 12:57:48'::timestamp without time zone) AND ((reference_type)::text = 'Bonus
19. 0.000 0.000 ↓ 0.0

Seq Scan on casino_balance_transactions_2020_w08 (cost=0.00..3.59 rows=42 width=8) (actual rows= loops=)

  • Filter: ((amount_cents > 0) AND (created_at < '2020-08-11 12:57:48'::timestamp without time zone) AND ((reference_type)::text = 'Bonus
20. 0.000 0.000 ↓ 0.0

Seq Scan on casino_balance_transactions_2020_w09 (cost=0.00..6.12 rows=45 width=8) (actual rows= loops=)

  • Filter: ((amount_cents > 0) AND (created_at < '2020-08-11 12:57:48'::timestamp without time zone) AND ((reference_type)::text = 'Bonus
21. 0.000 0.000 ↓ 0.0

Seq Scan on casino_balance_transactions_2020_w10 (cost=0.00..7.03 rows=52 width=8) (actual rows= loops=)

  • Filter: ((amount_cents > 0) AND (created_at < '2020-08-11 12:57:48'::timestamp without time zone) AND ((reference_type)::text = 'Bonus
22. 0.000 0.000 ↓ 0.0

Seq Scan on casino_balance_transactions_2020_w11 (cost=0.00..6.69 rows=60 width=8) (actual rows= loops=)

  • Filter: ((amount_cents > 0) AND (created_at < '2020-08-11 12:57:48'::timestamp without time zone) AND ((reference_type)::text = 'Bonus
23. 0.000 0.000 ↓ 0.0

Seq Scan on casino_balance_transactions_2020_w12 (cost=0.00..3.93 rows=31 width=8) (actual rows= loops=)

  • Filter: ((amount_cents > 0) AND (created_at < '2020-08-11 12:57:48'::timestamp without time zone) AND ((reference_type)::text = 'Bonus
24. 0.000 0.000 ↓ 0.0

Seq Scan on casino_balance_transactions_2020_w13 (cost=0.00..5.99 rows=34 width=8) (actual rows= loops=)

  • Filter: ((amount_cents > 0) AND (created_at < '2020-08-11 12:57:48'::timestamp without time zone) AND ((reference_type)::text = 'Bonus
25. 0.000 0.000 ↓ 0.0

Seq Scan on casino_balance_transactions_2020_w14 (cost=0.00..6.61 rows=42 width=8) (actual rows= loops=)

  • Filter: ((amount_cents > 0) AND (created_at < '2020-08-11 12:57:48'::timestamp without time zone) AND ((reference_type)::text = 'Bonus
26. 0.000 0.000 ↓ 0.0

Seq Scan on casino_balance_transactions_2020_w15 (cost=0.00..18.31 rows=270 width=8) (actual rows= loops=)

  • Filter: ((amount_cents > 0) AND (created_at < '2020-08-11 12:57:48'::timestamp without time zone) AND ((reference_type)::text = 'Bonus
27. 0.000 0.000 ↓ 0.0

Seq Scan on casino_balance_transactions_2020_w16 (cost=0.00..3.79 rows=36 width=8) (actual rows= loops=)

  • Filter: ((amount_cents > 0) AND (created_at < '2020-08-11 12:57:48'::timestamp without time zone) AND ((reference_type)::text = 'Bonus
28. 0.000 0.000 ↓ 0.0

Seq Scan on casino_balance_transactions_2020_w17 (cost=0.00..11.28 rows=105 width=8) (actual rows= loops=)

  • Filter: ((amount_cents > 0) AND (created_at < '2020-08-11 12:57:48'::timestamp without time zone) AND ((reference_type)::text = 'Bonus
29. 0.000 0.000 ↓ 0.0

Seq Scan on casino_balance_transactions_2020_w18 (cost=0.00..6.69 rows=82 width=8) (actual rows= loops=)

  • Filter: ((amount_cents > 0) AND (created_at < '2020-08-11 12:57:48'::timestamp without time zone) AND ((reference_type)::text = 'Bonus
30. 0.000 0.000 ↓ 0.0

Seq Scan on casino_balance_transactions_2020_w19 (cost=0.00..17.01 rows=156 width=8) (actual rows= loops=)

  • Filter: ((amount_cents > 0) AND (created_at < '2020-08-11 12:57:48'::timestamp without time zone) AND ((reference_type)::text = 'Bonus
31. 0.000 0.000 ↓ 0.0

Seq Scan on casino_balance_transactions_2020_w20 (cost=0.00..4.36 rows=36 width=8) (actual rows= loops=)

  • Filter: ((amount_cents > 0) AND (created_at < '2020-08-11 12:57:48'::timestamp without time zone) AND ((reference_type)::text = 'Bonus
32. 0.000 0.000 ↓ 0.0

Seq Scan on casino_balance_transactions_2020_w21 (cost=0.00..6.46 rows=48 width=8) (actual rows= loops=)

  • Filter: ((amount_cents > 0) AND (created_at < '2020-08-11 12:57:48'::timestamp without time zone) AND ((reference_type)::text = 'Bonus
33. 0.000 0.000 ↓ 0.0

Seq Scan on casino_balance_transactions_2020_w22 (cost=0.00..11.67 rows=45 width=8) (actual rows= loops=)

  • Filter: ((amount_cents > 0) AND (created_at < '2020-08-11 12:57:48'::timestamp without time zone) AND ((reference_type)::text = 'Bonus
34. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on casino_balance_transactions_2020_w23 (cost=5.02..13.73 rows=32 width=8) (actual rows= loops=)

  • Recheck Cond: ((reference_type)::text = 'BonusIssue'::text)
  • Filter: ((amount_cents > 0) AND (created_at < '2020-08-11 12:57:48'::timestamp without time zone))
35. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on casino_balance_transactions_2_reference_type_reference_id_idx21 (cost=0.00..5.01 rows=98 width=0) (actual rows= loops=)

  • Index Cond: ((reference_type)::text = 'BonusIssue'::text)
36. 0.000 0.000 ↓ 0.0

Seq Scan on casino_balance_transactions_2020_w24 (cost=0.00..15.80 rows=75 width=8) (actual rows= loops=)

  • Filter: ((amount_cents > 0) AND (created_at < '2020-08-11 12:57:48'::timestamp without time zone) AND ((reference_type)::text = 'Bonus
37. 0.000 0.000 ↓ 0.0

Seq Scan on casino_balance_transactions_2020_w25 (cost=0.00..14.49 rows=83 width=8) (actual rows= loops=)

  • Filter: ((amount_cents > 0) AND (created_at < '2020-08-11 12:57:48'::timestamp without time zone) AND ((reference_type)::text = 'Bonus
38. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on casino_balance_transactions_2020_w26 (cost=9.54..22.44 rows=68 width=8) (actual rows= loops=)

  • Recheck Cond: ((reference_type)::text = 'BonusIssue'::text)
  • Filter: ((amount_cents > 0) AND (created_at < '2020-08-11 12:57:48'::timestamp without time zone))
39. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on casino_balance_transactions_2_reference_type_reference_id_idx24 (cost=0.00..9.52 rows=166 width=0) (actual rows= loops=)

  • Index Cond: ((reference_type)::text = 'BonusIssue'::text)
40. 0.000 0.000 ↓ 0.0

Seq Scan on casino_balance_transactions_2020_w27 (cost=0.00..6.20 rows=40 width=8) (actual rows= loops=)

  • Filter: ((amount_cents > 0) AND (created_at < '2020-08-11 12:57:48'::timestamp without time zone) AND ((reference_type)::text = 'Bonus
41. 0.000 0.000 ↓ 0.0

Seq Scan on casino_balance_transactions_2020_w28 (cost=0.00..73.95 rows=1,703 width=8) (actual rows= loops=)

  • Filter: ((amount_cents > 0) AND (created_at < '2020-08-11 12:57:48'::timestamp without time zone) AND ((reference_type)::text = 'Bonus
42. 0.000 0.000 ↓ 0.0

Seq Scan on casino_balance_transactions_2020_w29 (cost=0.00..77.25 rows=266 width=8) (actual rows= loops=)

  • Filter: ((amount_cents > 0) AND (created_at < '2020-08-11 12:57:48'::timestamp without time zone) AND ((reference_type)::text = 'Bonus
43. 0.000 0.000 ↓ 0.0

Seq Scan on casino_balance_transactions_2020_w30 (cost=0.00..19.09 rows=131 width=8) (actual rows= loops=)

  • Filter: ((amount_cents > 0) AND (created_at < '2020-08-11 12:57:48'::timestamp without time zone) AND ((reference_type)::text = 'Bonus
44. 0.000 0.000 ↓ 0.0

Seq Scan on casino_balance_transactions_2020_w31 (cost=0.00..9.43 rows=79 width=8) (actual rows= loops=)

  • Filter: ((amount_cents > 0) AND (created_at < '2020-08-11 12:57:48'::timestamp without time zone) AND ((reference_type)::text = 'Bonus
  • Index Cond: ((reference_type)::text = 'BonusIssue'::text)
  • Filter: ((amount_cents > 0) AND (created_at < '2020-08-11 12:57:48'::timestamp without time zone))
  • Index Cond: ((reference_type)::text = 'BonusIssue'::text)
  • Filter: ((amount_cents > 0) AND (created_at < '2020-08-11 12:57:48'::timestamp without time zone))
45. 0.000 0.000 ↓ 0.0

Index Scan using accounts_pkey on accounts (cost=0.28..1.56 rows=1 width=12) (actual rows= loops=)

  • Index Cond: (id = bonus_issues.account_id)
46. 0.000 0.000 ↓ 0.0

Index Scan using payments_pkey on payments (cost=0.29..4.68 rows=1 width=16) (actual rows= loops=)

  • Index Cond: (bonus_issues.payment_id = id)
47.          

SubPlan (for GroupAggregate)

48. 0.000 0.000 ↓ 0.0

Aggregate (cost=8.50..8.51 rows=1 width=32) (actual rows= loops=)

49. 0.000 0.000 ↓ 0.0

Index Scan using index_dense_balance_transactions_on_bonus_issue_id on dense_balance_transactions (cost=0.29..8.50 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (bonus_issue_id = bonus_issues.id)
  • Filter: (((action)::text = ANY ('{bet,win}'::text[])) AND (dense_created_at < '2020-08-11 12:57:48'::timestamp without time zone))
50. 0.000 0.000 ↓ 0.0

Aggregate (cost=8.50..8.51 rows=1 width=32) (actual rows= loops=)

51. 0.000 0.000 ↓ 0.0

Index Scan using index_dense_balance_transactions_on_bonus_issue_id on dense_balance_transactions dense_balance_transactions_1 (cost=0.29..8.50 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (bonus_issue_id = bonus_issues.id)
  • Filter: ((dense_created_at < '2020-08-11 12:57:48'::timestamp without time zone) AND ((action)::text = 'bet'::text))
52. 0.000 0.000 ↓ 0.0

Aggregate (cost=8.50..8.51 rows=1 width=32) (actual rows= loops=)

53. 0.000 0.000 ↓ 0.0

Index Scan using index_dense_balance_transactions_on_bonus_issue_id on dense_balance_transactions dense_balance_transactions_2 (cost=0.29..8.50 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (bonus_issue_id = bonus_issues.id)
  • Filter: (((action)::text = ANY ('{bet,win}'::text[])) AND (dense_created_at < '2020-08-11 12:57:48'::timestamp without time zone))
54. 0.000 0.000 ↓ 0.0

Aggregate (cost=8.50..8.51 rows=1 width=32) (actual rows= loops=)

55. 0.000 0.000 ↓ 0.0

Index Scan using index_dense_balance_transactions_on_bonus_issue_id on dense_balance_transactions dense_balance_transactions_3 (cost=0.29..8.50 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (bonus_issue_id = bonus_issues.id)
  • Filter: ((dense_created_at < '2020-08-11 12:57:48'::timestamp without time zone) AND ((action)::text = 'bet'::text))
56. 0.000 0.000 ↓ 0.0

Aggregate (cost=8.50..8.51 rows=1 width=32) (actual rows= loops=)

57. 0.000 0.000 ↓ 0.0

Index Scan using index_dense_balance_transactions_on_bonus_issue_id on dense_balance_transactions dense_balance_transactions_4 (cost=0.29..8.50 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (bonus_issue_id = bonus_issues.id)
  • Filter: (((action)::text = ANY ('{bet,win}'::text[])) AND (dense_created_at < '2020-08-11 12:57:48'::timestamp without time zone))
58. 0.000 0.000 ↓ 0.0

Aggregate (cost=8.50..8.51 rows=1 width=32) (actual rows= loops=)

59. 0.000 0.000 ↓ 0.0

Index Scan using index_dense_balance_transactions_on_bonus_issue_id on dense_balance_transactions dense_balance_transactions_5 (cost=0.29..8.50 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (bonus_issue_id = bonus_issues.id)
  • Filter: ((dense_created_at < '2020-08-11 12:57:48'::timestamp without time zone) AND ((action)::text = 'bet'::text))
60. 0.000 0.000 ↓ 0.0

Aggregate (cost=8.50..8.51 rows=1 width=32) (actual rows= loops=)

61. 0.000 0.000 ↓ 0.0

Index Scan using index_dense_balance_transactions_on_bonus_issue_id on dense_balance_transactions dense_balance_transactions_6 (cost=0.29..8.50 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (bonus_issue_id = bonus_issues.id)
  • Filter: (((action)::text = ANY ('{bet,win}'::text[])) AND (dense_created_at < '2020-08-11 12:57:48'::timestamp without time zone))
62. 0.000 0.000 ↓ 0.0

Aggregate (cost=8.50..8.51 rows=1 width=32) (actual rows= loops=)

63. 0.000 0.000 ↓ 0.0

Index Scan using index_dense_balance_transactions_on_bonus_issue_id on dense_balance_transactions dense_balance_transactions_7 (cost=0.29..8.50 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (bonus_issue_id = bonus_issues.id)
  • Filter: ((dense_created_at < '2020-08-11 12:57:48'::timestamp without time zone) AND ((action)::text = 'bet'::text))