explain.depesz.com

PostgreSQL's explain analyze made readable

Result: aqy6

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

Result (cost=0.00..1,746,865.05 rows=16 width=88) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Append (cost=0.00..2.16 rows=16 width=56) (actual rows= loops=)

3. 0.000 0.000 ↓ 0.0

Seq Scan on base_currencies (cost=0.00..1.08 rows=8 width=56) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Seq Scan on base_currencies base_currencies_1 (cost=0.00..1.08 rows=8 width=56) (actual rows= loops=)

5.          

SubPlan (forResult)

6. 0.000 0.000 ↓ 0.0

Index Scan using idx_transactions__user_currency_type_status_operation on transactions t_1 (cost=13,147.30..13,314.50 rows=1 width=5) (actual rows= loops=)

  • Index Cond: ((user_id = 508012) AND ((currency_id)::text = (base_currencies.name)::text) AND ((type)::text = ('period_balance'::text)) AND (created_at = COALESCE($2, '1970-01-01 00:00:00'::timestamp without time zone)))
7.          

Initplan (forIndex Scan)

8. 0.000 0.000 ↓ 0.0

Aggregate (cost=13,146.73..13,146.74 rows=1 width=8) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on transactions t (cost=122.15..13,136.20 rows=4,213 width=8) (actual rows= loops=)

  • Recheck Cond: ((user_id = 508012) AND ((currency_id)::text = (base_currencies.name)::text) AND ((type)::text = ('period_balance'::text)))
10. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on transactions__index_test (cost=0.00..121.09 rows=4,213 width=0) (actual rows= loops=)

  • Index Cond: ((user_id = 508012) AND ((currency_id)::text = (base_currencies.name)::text) AND ((type)::text = ('period_balance'::text)))
11. 0.000 0.000 ↓ 0.0

Aggregate (cost=18,882.81..18,882.82 rows=1 width=32) (actual rows= loops=)

12.          

Initplan (forAggregate)

13. 0.000 0.000 ↓ 0.0

Aggregate (cost=13,146.73..13,146.74 rows=1 width=8) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on transactions t_2 (cost=122.15..13,136.20 rows=4,213 width=8) (actual rows= loops=)

  • Recheck Cond: ((user_id = 508012) AND ((currency_id)::text = (base_currencies.name)::text) AND ((type)::text = ('period_balance'::text)))
15. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on transactions__index_test (cost=0.00..121.09 rows=4,213 width=0) (actual rows= loops=)

  • Index Cond: ((user_id = 508012) AND ((currency_id)::text = (base_currencies.name)::text) AND ((type)::text = ('period_balance'::text)))
16. 0.000 0.000 ↓ 0.0

Index Scan using idx_transactions__user_currency_type_status_operation on transactions t_3 (cost=0.56..5,731.82 rows=1,698 width=5) (actual rows= loops=)

  • Index Cond: ((user_id = 508012) AND ((currency_id)::text = (base_currencies.name)::text) AND ((type)::text = 'debit'::text) AND (status = 3) AND (created_at > COALESCE($5, '1970-01-01 00:00:00'::timestamp without time zone)))
17. 0.000 0.000 ↓ 0.0

Aggregate (cost=22,513.23..22,513.24 rows=1 width=32) (actual rows= loops=)

18.          

Initplan (forAggregate)

19. 0.000 0.000 ↓ 0.0

Aggregate (cost=13,146.73..13,146.74 rows=1 width=8) (actual rows= loops=)

20. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on transactions t_4 (cost=122.15..13,136.20 rows=4,213 width=8) (actual rows= loops=)

  • Recheck Cond: ((user_id = 508012) AND ((currency_id)::text = (base_currencies.name)::text) AND ((type)::text = ('period_balance'::text)))
21. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on transactions__index_test (cost=0.00..121.09 rows=4,213 width=0) (actual rows= loops=)

  • Index Cond: ((user_id = 508012) AND ((currency_id)::text = (base_currencies.name)::text) AND ((type)::text = ('period_balance'::text)))
22. 0.000 0.000 ↓ 0.0

Index Scan using idx_transactions__user_currency_type_status_operation on transactions t_5 (cost=0.56..9,359.48 rows=2,799 width=5) (actual rows= loops=)

  • Index Cond: ((user_id = 508012) AND ((currency_id)::text = (base_currencies.name)::text) AND ((type)::text = 'credit'::text) AND (status = 3) AND (created_at > COALESCE($8, '1970-01-01 00:00:00'::timestamp without time zone)))
23. 0.000 0.000 ↓ 0.0

Index Scan using idx_transactions__user_currency_type_status_operation on transactions t_7 (cost=13,147.30..13,314.50 rows=1 width=5) (actual rows= loops=)

  • Index Cond: ((user_id = 508012) AND ((currency_id)::text = (base_currencies.name)::text) AND ((type)::text = ('period_balance'::text)) AND (created_at = COALESCE($11, '1970-01-01 00:00:00'::timestamp without time zone)))
24.          

Initplan (forIndex Scan)

25. 0.000 0.000 ↓ 0.0

Aggregate (cost=13,146.73..13,146.74 rows=1 width=8) (actual rows= loops=)

26. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on transactions t_6 (cost=122.15..13,136.20 rows=4,213 width=8) (actual rows= loops=)

  • Recheck Cond: ((user_id = 508012) AND ((currency_id)::text = (base_currencies.name)::text) AND ((type)::text = ('period_balance'::text)))
27. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on transactions__index_test (cost=0.00..121.09 rows=4,213 width=0) (actual rows= loops=)

  • Index Cond: ((user_id = 508012) AND ((currency_id)::text = (base_currencies.name)::text) AND ((type)::text = ('period_balance'::text)))
28. 0.000 0.000 ↓ 0.0

Index Scan using idx_transactions__user_currency_type_status_operation on transactions t_9 (cost=13,147.30..13,314.50 rows=1 width=5) (actual rows= loops=)

  • Index Cond: ((user_id = 508012) AND ((currency_id)::text = (base_currencies.name)::text) AND ((type)::text = ('period_balance'::text)) AND (created_at = COALESCE($14, '1970-01-01 00:00:00'::timestamp without time zone)))
29.          

Initplan (forIndex Scan)

30. 0.000 0.000 ↓ 0.0

Aggregate (cost=13,146.73..13,146.74 rows=1 width=8) (actual rows= loops=)

31. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on transactions t_8 (cost=122.15..13,136.20 rows=4,213 width=8) (actual rows= loops=)

  • Recheck Cond: ((user_id = 508012) AND ((currency_id)::text = (base_currencies.name)::text) AND ((type)::text = ('period_balance'::text)))
32. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on transactions__index_test (cost=0.00..121.09 rows=4,213 width=0) (actual rows= loops=)

  • Index Cond: ((user_id = 508012) AND ((currency_id)::text = (base_currencies.name)::text) AND ((type)::text = ('period_balance'::text)))
33. 0.000 0.000 ↓ 0.0

Aggregate (cost=13,744.10..13,744.11 rows=1 width=32) (actual rows= loops=)

34.          

Initplan (forAggregate)

35. 0.000 0.000 ↓ 0.0

Aggregate (cost=13,146.73..13,146.74 rows=1 width=8) (actual rows= loops=)

36. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on transactions t_10 (cost=122.15..13,136.20 rows=4,213 width=8) (actual rows= loops=)

  • Recheck Cond: ((user_id = 508012) AND ((currency_id)::text = (base_currencies.name)::text) AND ((type)::text = ('period_balance'::text)))
37. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on transactions__index_test (cost=0.00..121.09 rows=4,213 width=0) (actual rows= loops=)

  • Index Cond: ((user_id = 508012) AND ((currency_id)::text = (base_currencies.name)::text) AND ((type)::text = ('period_balance'::text)))
38. 0.000 0.000 ↓ 0.0

Index Scan using idx_transactions__user_currency_type_status_operation on transactions t_11 (cost=0.56..596.92 rows=174 width=5) (actual rows= loops=)

  • Index Cond: ((user_id = 508012) AND ((currency_id)::text = (base_currencies.name)::text) AND ((type)::text = 'bonus_debit'::text) AND (status = 3) AND (created_at > COALESCE($17, '1970-01-01 00:00:00'::timestamp without time zone)))
39. 0.000 0.000 ↓ 0.0

Aggregate (cost=14,095.21..14,095.22 rows=1 width=32) (actual rows= loops=)

40.          

Initplan (forAggregate)

41. 0.000 0.000 ↓ 0.0

Aggregate (cost=13,146.73..13,146.74 rows=1 width=8) (actual rows= loops=)

42. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on transactions t_12 (cost=122.15..13,136.20 rows=4,213 width=8) (actual rows= loops=)

  • Recheck Cond: ((user_id = 508012) AND ((currency_id)::text = (base_currencies.name)::text) AND ((type)::text = ('period_balance'::text)))
43. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on transactions__index_test (cost=0.00..121.09 rows=4,213 width=0) (actual rows= loops=)

  • Index Cond: ((user_id = 508012) AND ((currency_id)::text = (base_currencies.name)::text) AND ((type)::text = ('period_balance'::text)))
44. 0.000 0.000 ↓ 0.0

Index Scan using idx_transactions__user_currency_type_status_operation on transactions t_13 (cost=0.56..947.77 rows=276 width=5) (actual rows= loops=)

  • Index Cond: ((user_id = 508012) AND ((currency_id)::text = (base_currencies.name)::text) AND ((type)::text = 'bonus_credit'::text) AND (status = 3) AND (created_at > COALESCE($20, '1970-01-01 00:00:00'::timestamp without time zone)))