explain.depesz.com

PostgreSQL's explain analyze made readable

Result: aTXE

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

GroupAggregate (cost=337,970,846,443.36..337,970,846,863.10 rows=2 width=49) (actual rows= loops=)

  • Group Key: rg_user.is_anonymous_user
2. 0.000 0.000 ↓ 0.0

Unique (cost=337,970,846,443.36..337,970,846,572.50 rows=12,914 width=9) (actual rows= loops=)

3. 0.000 0.000 ↓ 0.0

Sort (cost=337,970,846,443.36..337,970,846,475.64 rows=12,914 width=9) (actual rows= loops=)

  • Sort Key: rg_user.is_anonymous_user, rg_user.anonymous_user_id, rg_user.registered_user_id
4. 0.000 0.000 ↓ 0.0

Nested Loop (cost=701.60..337,970,845,561.55 rows=12,914 width=9) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Index Only Scan using rg_app_starts_first_last_user_id_mobile_application_id_sub_idx1 on rg_app_starts_first_last (cost=0.56..133,790.89 rows=554,921 width=4) (actual rows= loops=)

  • Index Cond: ((mobile_application_id = 'OVERALLKBP'::text) AND (subsidiary_country_id = 2,650))
6. 0.000 0.000 ↓ 0.0

Index Scan using rg_user_subsidiary_country_id_user_id_idx on rg_user (cost=701.04..609,042.92 rows=1 width=13) (actual rows= loops=)

  • Index Cond: ((subsidiary_country_id = 2,650) AND (user_id = rg_app_starts_first_last.user_id))
  • Filter: ((NOT is_anonymous_user) AND (NOT (SubPlan 1)))
7.          

SubPlan (for Index Scan)

8. 0.000 0.000 ↓ 0.0

Materialize (cost=700.60..1,201,441.26 rows=6,376,716 width=4) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Unique (cost=700.60..1,144,647.68 rows=6,376,716 width=4) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Merge Join (cost=700.60..1,128,705.89 rows=6,376,716 width=4) (actual rows= loops=)

  • Merge Cond: (rg_receipt.user_id = rg_user_1.user_id)
11. 0.000 0.000 ↓ 0.0

Index Scan using rg_receipt_user_id_idx on rg_receipt (cost=0.43..465,487.62 rows=6,376,716 width=4) (actual rows= loops=)

  • Filter: (subsidiary_country_id = 2,650)
12. 0.000 0.000 ↓ 0.0

Index Only Scan using rg_user_pkey on rg_user rg_user_1 (cost=0.43..557,525.89 rows=11,962,121 width=4) (actual rows= loops=)