explain.depesz.com

PostgreSQL's explain analyze made readable

Result: k3qI

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

Seq Scan on campaigns (cost=41.66..10,811.98 rows=45,194 width=2,577) (actual rows= loops=)

  • Filter: ((global AND (NOT $0)) OR (hashed SubPlan 2) OR (hashed SubPlan 3) OR (hashed SubPlan 4))
2.          

Initplan (for Seq Scan)

3. 0.000 0.000 ↓ 0.0

Index Scan using merchants_pkey on merchants (cost=0.06..4.06 rows=1 width=1) (actual rows= loops=)

  • Index Cond: (id = 4035)
4.          

SubPlan (for Seq Scan)

5. 0.000 0.000 ↓ 0.0

Index Only Scan using index_campaigns_merchants_on_merchant_id_and_campaign_id on campaigns_merchants (cost=0.08..29.43 rows=1,632 width=4) (actual rows= loops=)

  • Index Cond: (merchant_id = 4035)
6. 0.000 0.000 ↓ 0.0

Index Only Scan using index_campaigns_targeted_locations_on_location_and_campaign on campaigns_targeted_locations (cost=0.08..2.12 rows=7 width=4) (actual rows= loops=)

  • Index Cond: (location_id = 592363)
7. 0.000 0.000 ↓ 0.0

Nested Loop Semi Join (cost=0.06..5.23 rows=1 width=4) (actual rows= loops=)

  • Join Filter: (campaigns_targeted_location_groups.location_group_id = location_group_locations.location_group_id)
8. 0.000 0.000 ↓ 0.0

Seq Scan on campaigns_targeted_location_groups (cost=0.00..1.07 rows=24 width=8) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Materialize (cost=0.06..4.06 rows=1 width=4) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Index Scan using index_location_group_locations_on_location_id on location_group_locations (cost=0.06..4.06 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (location_id = 592363)