explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 21d4

Settings
# exclusive inclusive rows x rows loops node
1. 0.016 1,656.686 ↑ 434.0 5 1

Sort (cost=35,706.32..35,711.74 rows=2,170 width=20) (actual time=1,656.685..1,656.686 rows=5 loops=1)

  • Sort Key: ce1.start_time, ce1.last_event_seating_asked_at
  • Sort Method: quicksort Memory: 25kB
2. 0.019 1,656.670 ↑ 434.0 5 1

Hash Anti Join (cost=843.99..35,586.06 rows=2,170 width=20) (actual time=1,118.748..1,656.670 rows=5 loops=1)

  • Hash Cond: (ce1.id = eslq1.event_id)
3. 2.463 1,655.965 ↑ 434.0 5 1

Nested Loop (cost=841.71..35,556.39 rows=2,170 width=20) (actual time=1,118.048..1,655.965 rows=5 loops=1)

4. 59.945 1,570.052 ↓ 6.9 16,690 1

Hash Join (cost=841.28..33,050.83 rows=2,415 width=20) (actual time=12.367..1,570.052 rows=16,690 loops=1)

  • Hash Cond: (gp1.timezone_id = t1.id)
  • Join Filter: (((to_char(timezone((t1.name)::text, now()), 'HH24'::text))::smallint < 0) OR ((to_char(timezone((t1.name)::text, now()), 'HH24'::text))::smallint > 7) OR (ce1.created_at > (now() - '24:00:00'::interval)) OR (ce1.start_time < (now() + '24:00:00'::interval)))
5. 8.960 1,509.601 ↓ 5.7 16,690 1

Nested Loop (cost=830.43..33,031.81 rows=2,920 width=32) (actual time=11.823..1,509.601 rows=16,690 loops=1)

  • Join Filter: (ce1.consecutive_unsuccessful_event_seating_lookup_count < c1.maximum_consecutive_unsuccessful_event_seating_lookup_count)
6. 3.103 51.125 ↓ 7.8 1,821 1

Nested Loop (cost=830.00..1,399.02 rows=234 width=12) (actual time=9.584..51.125 rows=1,821 loops=1)

7. 0.827 21.021 ↓ 8.9 2,077 1

Nested Loop (cost=829.72..1,291.74 rows=234 width=12) (actual time=9.575..21.021 rows=2,077 loops=1)

8. 1.013 13.774 ↓ 12.2 428 1

Nested Loop (cost=829.43..1,132.23 rows=35 width=12) (actual time=9.566..13.774 rows=428 loops=1)

9. 0.489 10.313 ↓ 4.1 816 1

Unique (cost=829.16..834.23 rows=200 width=12) (actual time=9.554..10.313 rows=816 loops=1)

10. 0.477 9.824 ↑ 1.2 844 1

Sort (cost=829.16..831.70 rows=1,015 width=12) (actual time=9.553..9.824 rows=844 loops=1)

  • Sort Key: "*SELECT* 1".cinema_id, ((0)::bigint) DESC
  • Sort Method: quicksort Memory: 64kB
11. 0.524 9.347 ↑ 1.2 844 1

HashAggregate (cost=758.17..768.32 rows=1,015 width=12) (actual time=9.169..9.347 rows=844 loops=1)

  • Group Key: "*SELECT* 1".cinema_id, ((0)::bigint)
12. 0.117 8.823 ↑ 1.2 844 1

Append (cost=0.28..753.10 rows=1,015 width=12) (actual time=0.011..8.823 rows=844 loops=1)

13. 0.202 0.595 ↑ 1.0 816 1

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

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

  • Heap Fetches: 66
15. 0.176 8.111 ↑ 7.1 28 1

HashAggregate (cost=657.33..659.32 rows=199 width=12) (actual time=8.104..8.111 rows=28 loops=1)

  • Group Key: e1_1.cinema_id
16. 0.114 7.935 ↓ 1.8 364 1

Nested Loop (cost=0.85..656.33 rows=199 width=4) (actual time=0.066..7.935 rows=364 loops=1)

17. 4.909 4.909 ↓ 1.8 364 1

Index Scan using event_seating_lookup_ended_at_idx on event_seating_lookup esl1 (cost=0.42..170.28 rows=199 width=4) (actual time=0.051..4.909 rows=364 loops=1)

  • Index Cond: (ended_at IS NULL)
18. 2.912 2.912 ↑ 1.0 1 364

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=364)

  • Index Cond: (id = esl1.event_id)
19. 2.448 2.448 ↑ 1.0 1 816

Index Scan using cinema_pkey on cinema c1 (cost=0.28..1.47 rows=1 width=12) (actual time=0.003..0.003 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. 6.420 6.420 ↓ 1.2 5 428

Index Scan using public_venue_cinema_id0_idx on venue v1 (cost=0.28..4.52 rows=4 width=12) (actual time=0.004..0.015 rows=5 loops=428)

  • Index Cond: (cinema_id = c1.id)
21. 27.001 27.001 ↑ 1.0 1 2,077

Index Scan using google_place_pkey on google_place gp1 (cost=0.29..0.46 rows=1 width=8) (actual time=0.013..0.013 rows=1 loops=2,077)

  • Index Cond: (id = v1.google_place_id)
22. 1,449.516 1,449.516 ↑ 12.4 9 1,821

Index Scan using current_event_venue_id_idx on current_event ce1 (cost=0.42..133.78 rows=112 width=36) (actual time=0.521..0.796 rows=9 loops=1,821)

  • Index Cond: (venue_id = v1.id)
  • 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: 237
23. 0.061 0.506 ↑ 1.0 260 1

Hash (cost=7.60..7.60 rows=260 width=19) (actual time=0.505..0.506 rows=260 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 22kB
24. 0.445 0.445 ↑ 1.0 260 1

Seq Scan on timezone t1 (cost=0.00..7.60 rows=260 width=19) (actual time=0.022..0.445 rows=260 loops=1)

25. 83.450 83.450 ↓ 0.0 0 16,690

Index Scan using event_pkey on event e1 (cost=0.43..1.04 rows=1 width=4) (actual time=0.005..0.005 rows=0 loops=16,690)

  • Index Cond: (id = ce1.id)
  • Filter: ((unlisted_at IS NULL) AND (auditorium_id IS NOT NULL))
  • Rows Removed by Filter: 1
26. 0.001 0.686 ↓ 0.0 0 1

Hash (cost=2.27..2.27 rows=1 width=4) (actual time=0.686..0.686 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
27. 0.685 0.685 ↓ 0.0 0 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.685..0.685 rows=0 loops=1)

  • Index Cond: (attempted_at IS NULL)
Planning time : 10.089 ms
Execution time : 1,656.950 ms