explain.depesz.com

PostgreSQL's explain analyze made readable

Result: munS

Settings
# exclusive inclusive rows x rows loops node
1. 0.040 2,273.269 ↑ 1.0 100 1

Limit (cost=1,152.85..11,131.35 rows=100 width=20) (actual time=1,668.722..2,273.269 rows=100 loops=1)

2. 0.100 2,273.229 ↑ 61.5 100 1

Nested Loop Anti Join (cost=1,152.85..614,531.31 rows=6,147 width=20) (actual time=1,668.721..2,273.229 rows=100 loops=1)

3. 444.963 2,272.547 ↑ 31.7 194 1

Nested Loop (cost=1,152.58..612,742.04 rows=6,151 width=20) (actual time=1,668.710..2,272.547 rows=194 loops=1)

  • Join Filter: (e1.cinema_id = c1.id)
  • Rows Removed by Join Filter: 4241753
4. 31.117 1,561.229 ↑ 14.5 9,865 1

Nested Loop (cost=0.98..536,273.02 rows=142,884 width=24) (actual time=168.491..1,561.229 rows=9,865 loops=1)

5. 1,329.977 1,329.977 ↑ 4.8 40,027 1

Index Scan using current_event_event_seating_asked_at_idx on current_event ce1 (cost=0.55..323,670.91 rows=191,043 width=28) (actual time=0.038..1,329.977 rows=40,027 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: 467770
6. 200.135 200.135 ↓ 0.0 0 40,027

Index Scan using event_pkey on event e1 (cost=0.43..1.10 rows=1 width=22) (actual time=0.005..0.005 rows=0 loops=40,027)

  • 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
7. 258.166 266.355 ↓ 12.3 430 9,865

Materialize (cost=1,151.60..1,455.01 rows=35 width=8) (actual time=0.001..0.027 rows=430 loops=9,865)

8. 0.444 8.189 ↓ 12.3 430 1

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

9. 0.250 6.113 ↓ 4.1 816 1

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

10. 0.346 5.863 ↑ 1.3 836 1

Sort (cost=1,151.32..1,154.08 rows=1,103 width=12) (actual time=5.742..5.863 rows=836 loops=1)

  • Sort Key: "*SELECT* 1".cinema_id, ((0)::bigint) DESC
  • Sort Method: quicksort Memory: 64kB
11. 0.462 5.517 ↑ 1.3 836 1

HashAggregate (cost=1,073.52..1,084.55 rows=1,103 width=12) (actual time=5.337..5.517 rows=836 loops=1)

  • Group Key: "*SELECT* 1".cinema_id, ((0)::bigint)
12. 0.087 5.055 ↑ 1.3 836 1

Append (cost=0.28..1,068.01 rows=1,103 width=12) (actual time=0.014..5.055 rows=836 loops=1)

13. 0.157 0.497 ↑ 1.0 816 1

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

14. 0.340 0.340 ↑ 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.011..0.340 rows=816 loops=1)

  • Heap Fetches: 66
15. 0.083 4.471 ↑ 14.3 20 1

HashAggregate (cost=970.04..972.91 rows=287 width=12) (actual time=4.462..4.471 rows=20 loops=1)

  • Group Key: e1_1.cinema_id
16. 0.047 4.388 ↑ 1.5 195 1

Nested Loop (cost=0.85..968.60 rows=287 width=4) (actual time=0.066..4.388 rows=195 loops=1)

17. 2.586 2.586 ↑ 1.5 195 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.053..2.586 rows=195 loops=1)

  • Index Cond: (ended_at IS NULL)
18. 1.755 1.755 ↑ 1.0 1 195

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

  • Index Cond: (id = esl1.event_id)
19. 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
20. 0.582 0.582 ↓ 0.0 0 194

Index Only Scan using event_seating_lookup_queue_event_id_idx on event_seating_lookup_queue eslq1 (cost=0.27..0.29 rows=1 width=4) (actual time=0.003..0.003 rows=0 loops=194)

  • Index Cond: (event_id = ce1.id)
  • Heap Fetches: 94
Planning time : 3.407 ms
Execution time : 2,273.476 ms