explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Dh11

Settings
# exclusive inclusive rows x rows loops node
1. 19.836 830.784 ↑ 1.2 29,576 1

Sort (cost=122,617.88..122,709.67 rows=36,717 width=20) (actual time=827.308..830.784 rows=29,576 loops=1)

  • Sort Key: ce1.start_time, ce1.last_event_seating_asked_at
  • Sort Method: quicksort Memory: 3079kB
2. 8.675 810.948 ↑ 1.2 29,576 1

Hash Anti Join (cost=2,565.87..119,833.97 rows=36,717 width=20) (actual time=6.545..810.948 rows=29,576 loops=1)

  • Hash Cond: (ce1.id = eslq1.event_id)
3. 19.505 802.076 ↑ 1.2 29,692 1

Hash Join (cost=2,563.59..119,368.14 rows=36,717 width=20) (actual time=6.335..802.076 rows=29,692 loops=1)

  • Hash Cond: (ce1.venue_id = v1.id)
  • Join Filter: (ce1.consecutive_unsuccessful_event_seating_lookup_count < c1.maximum_consecutive_unsuccessful_event_seating_lookup_count)
4. 776.579 776.579 ↑ 5.1 41,197 1

Index Scan using current_event_start_time_idx on current_event ce1 (cost=0.43..114,644.38 rows=209,031 width=28) (actual time=0.327..776.579 rows=41,197 loops=1)

  • Index Cond: (start_time > now())
  • Filter: ((event_seating_updated_at IS NOT NULL) AND (unrecoverable_error IS NULL) AND (CASE WHEN ((last_event_seating_asked_at < (now() - '00:05:00'::interval)) AND (start_time < (now() + '00:15:00'::interval))) THEN 'NEXT_IMMEDIATE'::text WHEN ((last_event_seating_asked_at < (now() - '00:10:00'::interval)) AND (start_time < (now() + '01:00:00'::interval))) THEN 'NEXT_HOUR'::text WHEN ((last_event_seating_asked_at < (now() - '03:00:00'::interval)) AND (start_time < (now() + '1 day'::interval))) THEN 'NEXT_DAY'::text WHEN ((last_event_seating_asked_at < (now() - '06:00:00'::interval)) AND (start_time < (now() + '7 days'::interval))) THEN 'NEXT_WEEK'::text WHEN ((last_event_seating_asked_at < (now() - '06:00:00'::interval)) AND (start_time < (now() + '1 mon'::interval))) THEN 'NEXT_MONTH'::text WHEN (last_event_seating_asked_at < (now() - '12:00:00'::interval)) THEN 'NEXT_FUTURE'::text ELSE NULL::text END IS NOT NULL))
  • Rows Removed by Filter: 207220
5. 0.440 5.992 ↑ 1.3 2,212 1

Hash (cost=2,527.29..2,527.29 rows=2,870 width=8) (actual time=5.991..5.992 rows=2,212 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 119kB
6. 0.467 5.552 ↑ 1.3 2,212 1

Nested Loop (cost=0.56..2,527.29 rows=2,870 width=8) (actual time=0.009..5.552 rows=2,212 loops=1)

7. 1.215 1.215 ↑ 1.0 430 1

Index Scan using cinema_pkey on cinema c1 (cost=0.28..567.64 rows=430 width=8) (actual time=0.004..1.215 rows=430 loops=1)

  • Filter: (data_aggregation_disabled_at IS NULL)
  • Rows Removed by Filter: 386
8. 3.870 3.870 ↓ 1.2 5 430

Index Scan using public_venue_cinema_id0_idx on venue v1 (cost=0.28..4.52 rows=4 width=8) (actual time=0.003..0.009 rows=5 loops=430)

  • Index Cond: (cinema_id = c1.id)
9. 0.021 0.197 ↓ 116.0 116 1

Hash (cost=2.27..2.27 rows=1 width=4) (actual time=0.197..0.197 rows=116 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 13kB
10. 0.176 0.176 ↓ 116.0 116 1

Index Scan using event_seating_lookup_queue_attempted_at_idx on event_seating_lookup_queue eslq1 (cost=0.25..2.27 rows=1 width=4) (actual time=0.036..0.176 rows=116 loops=1)

  • Index Cond: (attempted_at IS NULL)
Planning time : 1.177 ms
Execution time : 832.527 ms