explain.depesz.com

PostgreSQL's explain analyze made readable

Result: uDum

Settings

Optimization(s) for this plan:

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

Nested Loop (cost=1,640,311.82..1,640,480.49 rows=20 width=79) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Limit (cost=1,640,311.39..1,640,311.44 rows=20 width=69) (actual rows= loops=)

3.          

Initplan (forLimit)

4. 0.000 0.000 ↓ 0.0

Index Scan using users_pkey on users users_1 (cost=0.42..8.44 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (id = 373)
5. 0.000 0.000 ↓ 0.0

Sort (cost=1,640,302.95..1,665,302.95 rows=10,000,001 width=69) (actual rows= loops=)

  • Sort Key: events.created_at DESC, events.name
6. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=53.56..1,374,206.52 rows=10,000,001 width=69) (actual rows= loops=)

  • Group Key: events.id
7. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=53.56..1,224,206.50 rows=10,000,001 width=69) (actual rows= loops=)

  • Merge Cond: (events.id = events_gender_filters.event_id)
  • Filter: ((NOT events.is_filter) OR (events_gender_filters.gender_id = $0))
8. 0.000 0.000 ↓ 0.0

Merge Left Join (cost=5.49..495,433.33 rows=10,000,001 width=70) (actual rows= loops=)

  • Merge Cond: (events.id = event_attendances.event_id)
9. 0.000 0.000 ↓ 0.0

Index Scan using events_pkey on events (cost=0.43..402,544.45 rows=10,000,001 width=62) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Index Scan using index_event_attendances_on_event_id on event_attendances (cost=0.42..55,391.70 rows=1,000,001 width=12) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Index Scan using index_events_gender_filters_on_event_id on events_gender_filters (cost=0.43..553,802.33 rows=10,000,001 width=8) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Index Scan using users_pkey on users (cost=0.42..8.44 rows=1 width=18) (actual rows= loops=)

  • Index Cond: (id = events.author_id)