explain.depesz.com

PostgreSQL's explain analyze made readable

Result: FDHg

Settings
# exclusive inclusive rows x rows loops node
1. 0.005 4,358.680 ↑ 6.2 16 1

Limit (cost=1,153.11..9,249.20 rows=100 width=20) (actual time=3,731.810..4,358.680 rows=16 loops=1)

2. 0.013 4,358.675 ↑ 384.6 16 1

Nested Loop Anti Join (cost=1,153.11..499,386.27 rows=6,154 width=20) (actual time=3,731.809..4,358.675 rows=16 loops=1)

  • Join Filter: (eslq1.event_id = ce1.id)
3. 0.640 4,358.630 ↑ 384.6 16 1

Nested Loop (cost=1,152.86..499,291.69 rows=6,154 width=20) (actual time=3,731.774..4,358.630 rows=16 loops=1)

4. 1,774.234 4,216.045 ↓ 3.5 28,389 1

Nested Loop (cost=1,152.43..490,136.23 rows=8,228 width=28) (actual time=5.270..4,216.045 rows=28,389 loops=1)

  • Join Filter: (v1.cinema_id = c1.id)
  • Rows Removed by Join Filter: 17110551
5. 14.688 1,405.503 ↑ 4.8 39,858 1

Nested Loop (cost=0.83..388,344.35 rows=191,118 width=32) (actual time=0.044..1,405.503 rows=39,858 loops=1)

6. 1,311.099 1,311.099 ↑ 4.8 39,858 1

Index Scan using current_event_event_seating_asked_at_idx on current_event ce1 (cost=0.55..323,670.91 rows=191,118 width=32) (actual time=0.036..1,311.099 rows=39,858 loops=1)

  • Filter: ((event_seating_updated_at IS NOT NULL) AND (unrecoverable_error IS NULL) AND (start_time > now()) 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) AND ((consecutive_unsuccessful_event_seating_lookup_count = 0) OR (last_event_seating_asked_at < (now() - ('00:00:01'::interval * (bound_power((consecutive_unsuccessful_event_seating_lookup_count + 1), 4, 1, 1440))::double precision)))))
  • Rows Removed by Filter: 499055
7. 79.716 79.716 ↑ 1.0 1 39,858

Index Scan using venue_pkey on venue v1 (cost=0.28..0.34 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=39,858)

  • Index Cond: (id = ce1.venue_id)
8. 1,031.078 1,036.308 ↓ 12.3 430 39,858

Materialize (cost=1,151.60..1,455.01 rows=35 width=8) (actual time=0.000..0.026 rows=430 loops=39,858)

9. 0.285 5.230 ↓ 12.3 430 1

Nested Loop (cost=1,151.60..1,454.84 rows=35 width=8) (actual time=3.010..5.230 rows=430 loops=1)

10. 0.235 3.313 ↓ 4.1 816 1

Unique (cost=1,151.32..1,156.84 rows=200 width=12) (actual time=2.998..3.313 rows=816 loops=1)

11. 0.278 3.078 ↑ 1.3 819 1

Sort (cost=1,151.32..1,154.08 rows=1,103 width=12) (actual time=2.997..3.078 rows=819 loops=1)

  • Sort Key: "*SELECT* 1".cinema_id, ((0)::bigint) DESC
  • Sort Method: quicksort Memory: 63kB
12. 0.428 2.800 ↑ 1.3 819 1

HashAggregate (cost=1,073.52..1,084.55 rows=1,103 width=12) (actual time=2.598..2.800 rows=819 loops=1)

  • Group Key: "*SELECT* 1".cinema_id, ((0)::bigint)
13. 0.088 2.372 ↑ 1.3 819 1

Append (cost=0.28..1,068.01 rows=1,103 width=12) (actual time=0.007..2.372 rows=819 loops=1)

14. 0.142 0.485 ↑ 1.0 816 1

Subquery Scan on *SELECT* 1 (cost=0.28..86.72 rows=816 width=12) (actual time=0.007..0.485 rows=816 loops=1)

15. 0.343 0.343 ↑ 1.0 816 1

Index Only Scan using cinema_pkey on cinema c1_1 (cost=0.28..76.52 rows=816 width=8) (actual time=0.006..0.343 rows=816 loops=1)

  • Heap Fetches: 66
16. 0.013 1.799 ↑ 95.7 3 1

HashAggregate (cost=970.04..972.91 rows=287 width=12) (actual time=1.796..1.799 rows=3 loops=1)

  • Group Key: e1_1.cinema_id
17. 0.005 1.786 ↑ 23.9 12 1

Nested Loop (cost=0.85..968.60 rows=287 width=4) (actual time=0.038..1.786 rows=12 loops=1)

18. 1.685 1.685 ↑ 23.9 12 1

Index Scan using event_seating_lookup_ended_at_idx on event_seating_lookup esl1 (cost=0.42..268.17 rows=287 width=4) (actual time=0.023..1.685 rows=12 loops=1)

  • Index Cond: (ended_at IS NULL)
19. 0.096 0.096 ↑ 1.0 1 12

Index Scan using event_pkey on event e1_1 (cost=0.43..2.44 rows=1 width=8) (actual time=0.008..0.008 rows=1 loops=12)

  • Index Cond: (id = esl1.event_id)
20. 1.632 1.632 ↑ 1.0 1 816

Index Scan using cinema_pkey on cinema c1 (cost=0.28..1.47 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=816)

  • Index Cond: (id = "*SELECT* 1".cinema_id)
  • Filter: ((data_aggregation_disabled_at IS NULL) AND (((0)::bigint) < maximum_event_seating_lookup_concurrency))
  • Rows Removed by Filter: 0
21. 141.945 141.945 ↓ 0.0 0 28,389

Index Scan using event_pkey on event e1 (cost=0.43..1.10 rows=1 width=18) (actual time=0.005..0.005 rows=0 loops=28,389)

  • Index Cond: (id = ce1.id)
  • Filter: ((auditorium_id IS NOT NULL) AND (timezone_name IS NOT NULL) AND (unlisted_at IS NULL) AND (((to_char(timezone(timezone_name, now()), 'HH24'::text))::smallint < 0) OR ((to_char(timezone(timezone_name, now()), 'HH24'::text))::smallint > 7) OR (ce1.created_at > (now() - '24:00:00'::interval)) OR (ce1.start_time < (now() + '24:00:00'::interval))))
  • Rows Removed by Filter: 1
22. 0.003 0.032 ↓ 0.0 0 16

Materialize (cost=0.25..2.27 rows=1 width=4) (actual time=0.002..0.002 rows=0 loops=16)

23. 0.029 0.029 ↓ 0.0 0 1

Index Only Scan using event_seating_lookup_queue_event_id_idx on event_seating_lookup_queue eslq1 (cost=0.25..2.27 rows=1 width=4) (actual time=0.029..0.029 rows=0 loops=1)

  • Heap Fetches: 33
Planning time : 2.391 ms
Execution time : 4,358.890 ms