explain.depesz.com

PostgreSQL's explain analyze made readable

Result: B4ZZ

Settings
# exclusive inclusive rows x rows loops node
1. 0.057 32.323 ↑ 1.0 1 1

GroupAggregate (cost=298.70..298.75 rows=1 width=49) (actual time=32.323..32.323 rows=1 loops=1)

  • Group Key: rg_user.is_anonymous_user
2. 0.007 32.266 ↓ 33.0 33 1

Unique (cost=298.70..298.71 rows=1 width=9) (actual time=32.258..32.266 rows=33 loops=1)

3. 0.125 32.259 ↓ 33.0 33 1

Sort (cost=298.70..298.70 rows=1 width=9) (actual time=32.257..32.259 rows=33 loops=1)

  • Sort Key: rg_user.is_anonymous_user, rg_user.anonymous_user_id, rg_user.registered_user_id
  • Sort Method: quicksort Memory: 26kB
4. 0.875 32.134 ↓ 33.0 33 1

Nested Loop (cost=36.47..298.69 rows=1 width=9) (actual time=10.136..32.134 rows=33 loops=1)

5. 11.581 11.645 ↓ 5.3 934 1

Index Scan using rg_user_subsidiary_country_id_idx on rg_user (cost=36.18..142.39 rows=177 width=13) (actual time=0.159..11.645 rows=934 loops=1)

  • Index Cond: (subsidiary_country_id = 350)
  • Filter: (valid AND (NOT is_anonymous_user) AND (NOT (hashed SubPlan 1)))
  • Rows Removed by Filter: 1,104
6.          

SubPlan (for Index Scan)

7. 0.000 0.064 ↓ 0.0 0 1

Unique (cost=35.63..35.72 rows=18 width=4) (actual time=0.064..0.064 rows=0 loops=1)

8. 0.010 0.064 ↓ 0.0 0 1

Sort (cost=35.63..35.67 rows=18 width=4) (actual time=0.064..0.064 rows=0 loops=1)

  • Sort Key: rg_user_1.user_id
  • Sort Method: quicksort Memory: 25kB
9. 0.001 0.054 ↓ 0.0 0 1

Nested Loop (cost=0.85..35.25 rows=18 width=4) (actual time=0.054..0.054 rows=0 loops=1)

10. 0.053 0.053 ↓ 0.0 0 1

Index Scan using rg_receipt_subsidiary_country_id_idx on rg_receipt (cost=0.42..7.35 rows=18 width=4) (actual time=0.053..0.053 rows=0 loops=1)

  • Index Cond: (subsidiary_country_id = 350)
11. 0.000 0.000 ↓ 0.0 0

Index Only Scan using rg_user_pkey on rg_user rg_user_1 (cost=0.42..1.54 rows=1 width=4) (never executed)

  • Index Cond: (user_id = rg_receipt.user_id)
  • Heap Fetches: 0
12. 19.614 19.614 ↓ 0.0 0 934

Index Only Scan using rg_app_starts_first_last_user_id_mobile_application_id_sub_idx1 on rg_app_starts_first_last (cost=0.29..0.87 rows=1 width=4) (actual time=0.021..0.021 rows=0 loops=934)

  • Index Cond: ((user_id = rg_user.user_id) AND (mobile_application_id = 'OVERALLKBP'::text) AND (subsidiary_country_id = 350))
  • Heap Fetches: 5
Planning time : 13.998 ms
Execution time : 32.578 ms