explain.depesz.com

PostgreSQL's explain analyze made readable

Result: aHy7

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 23,041.584 ↑ 1.0 2 1

Limit (cost=1.56..2,734.61 rows=2 width=52) (actual time=7,882.300..23,041.584 rows=2 loops=1)

2. 0.022 23,041.583 ↑ 50,658.5 2 1

Nested Loop Left Join (cost=1.56..138,452,132.96 rows=101,317 width=52) (actual time=7,882.299..23,041.583 rows=2 loops=1)

  • Join Filter: (aceslc1.event_id = e1.id)
  • Rows Removed by Join Filter: 194
  • Filter: ((aceslc1.active_cinema_event_seating_lookup_count IS NULL) OR (aceslc1.active_cinema_event_seating_lookup_count < 100))
3. 11,239.778 23,041.529 ↑ 50,658.5 2 1

Nested Loop Anti Join (cost=1.56..138,272,545.36 rows=101,317 width=20) (actual time=7,882.260..23,041.529 rows=2 loops=1)

  • Join Filter: (event_seating_lookup_queue.event_id = e1.id)
  • Rows Removed by Join Filter: 163797737
4. 15.277 173.705 ↑ 44.2 2,351 1

Nested Loop (cost=1.56..2,180,840.79 rows=103,962 width=20) (actual time=0.288..173.705 rows=2,351 loops=1)

  • Join Filter: (((to_char(timezone((t1.name)::text, now()), 'HH24'::text))::smallint < 0) OR ((to_char(timezone((t1.name)::text, now()), 'HH24'::text))::smallint > 10) OR (e1.created_at > (now() - '24:00:00'::interval)) OR (e1.starts_at < (now() + '24:00:00'::interval)))
5. 1.861 151.375 ↑ 45.1 2,351 1

Nested Loop (cost=1.41..2,156,214.39 rows=106,022 width=32) (actual time=0.275..151.375 rows=2,351 loops=1)

6. 61.110 142.461 ↑ 45.1 2,351 1

Nested Loop (cost=1.13..2,074,167.77 rows=106,022 width=32) (actual time=0.270..142.461 rows=2,351 loops=1)

  • Join Filter: (v1.locality_id = l1.id)
  • Rows Removed by Join Filter: 894476
7. 2.000 42.695 ↑ 43.9 2,416 1

Nested Loop (cost=1.13..686,618.06 rows=106,022 width=32) (actual time=0.080..42.695 rows=2,416 loops=1)

8. 5.958 33.447 ↑ 43.9 2,416 1

Nested Loop Left Join (cost=0.85..653,905.37 rows=106,022 width=32) (actual time=0.075..33.447 rows=2,416 loops=1)

  • Filter: ((ecliscv1.* IS NULL) OR ecliscv1.lookup_is_successful OR (e1.event_seating_asked_at < (now() - ('00:01:00'::interval * (bound_power((ecliscv1.consecutive_lookup_is_successful_without_change_count)::integer, 4, 1, 1440))::double precision))))
  • Rows Removed by Filter: 95
9. 12.423 12.423 ↑ 49.3 2,511 1

Index Scan using event_starts_at_idx on event e1 (cost=0.43..546,778.75 rows=123,722 width=32) (actual time=0.015..12.423 rows=2,511 loops=1)

  • Index Cond: (starts_at > (now() - '00:05:00'::interval))
  • Filter: ((event_seating_asked_at IS NOT NULL) AND (CASE WHEN ((event_seating_asked_at < (now() - '00:01:00'::interval)) AND (starts_at < (now() + '00:15:00'::interval))) THEN 'NEXT_QUARTER'::text WHEN ((event_seating_asked_at < (now() - '00:05:00'::interval)) AND (starts_at < (now() + '01:00:00'::interval))) THEN 'NEXT_HOUR'::text WHEN ((event_seating_asked_at < (now() - '00:30:00'::interval)) AND (starts_at < (now() + '1 day'::interval))) THEN 'NEXT_DAY'::text WHEN ((event_seating_asked_at < (now() - '01:00:00'::interval)) AND (starts_at < (now() + '7 days'::interval))) THEN 'NEXT_WEEK'::text WHEN ((event_seating_asked_at < (now() - '1 day'::interval)) AND (starts_at < (now() + '1 mon'::interval))) THEN 'NEXT_MONTH'::text ELSE NULL::text END IS NOT NULL))
  • Rows Removed by Filter: 286
10. 15.066 15.066 ↑ 1.0 1 2,511

Index Scan using event_consecutive_lookup_is_successful_count_view_event_id_idx on event_consecutive_lookup_is_successful_count_view ecliscv1 (cost=0.42..0.59 rows=1 width=50) (actual time=0.006..0.006 rows=1 loops=2,511)

  • Index Cond: (event_id = e1.id)
11. 7.248 7.248 ↑ 1.0 1 2,416

Index Scan using venue_pkey on venue v1 (cost=0.28..0.31 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=2,416)

  • Index Cond: (id = e1.venue_id)
12. 38.539 38.656 ↑ 2.4 371 2,416

Materialize (cost=0.00..56.10 rows=873 width=8) (actual time=0.000..0.016 rows=371 loops=2,416)

13. 0.117 0.117 ↑ 1.5 591 1

Seq Scan on locality l1 (cost=0.00..51.73 rows=873 width=8) (actual time=0.004..0.117 rows=591 loops=1)

14. 7.053 7.053 ↑ 1.0 1 2,351

Index Scan using google_place_pkey on google_place gp1 (cost=0.28..0.77 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=2,351)

  • Index Cond: (id = l1.google_place_id)
15. 7.053 7.053 ↑ 1.0 1 2,351

Index Scan using timezone_pkey on timezone t1 (cost=0.15..0.18 rows=1 width=19) (actual time=0.003..0.003 rows=1 loops=2,351)

  • Index Cond: (id = gp1.timezone_id)
16. 11,608.139 11,628.046 ↑ 1.3 69,673 2,351

Materialize (cost=0.00..3,585.50 rows=87,268 width=4) (actual time=0.002..4.946 rows=69,673 loops=2,351)

17. 19.907 19.907 ↓ 1.5 131,591 1

Seq Scan on event_seating_lookup_queue (cost=0.00..3,149.16 rows=87,268 width=4) (actual time=0.148..19.907 rows=131,591 loops=1)

  • Filter: ((attempted_at IS NULL) OR (attempted_at < (now() - '00:01:00'::interval)))
  • Rows Removed by Filter: 845
18. 0.017 0.032 ↑ 1.0 97 2

Materialize (cost=0.00..3.45 rows=97 width=12) (actual time=0.003..0.016 rows=97 loops=2)

19. 0.015 0.015 ↑ 1.0 97 1

Seq Scan on active_cinema_event_seating_lookup_count aceslc1 (cost=0.00..2.97 rows=97 width=12) (actual time=0.004..0.015 rows=97 loops=1)