explain.depesz.com

PostgreSQL's explain analyze made readable

Result: P6S4

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 4.464 ↓ 0.0 0 1

Limit (cost=61.83..61.85 rows=1 width=36) (actual time=4.462..4.464 rows=0 loops=1)

2. 0.000 4.462 ↓ 0.0 0 1

LockRows (cost=61.83..61.85 rows=1 width=36) (actual time=4.461..4.462 rows=0 loops=1)

3. 0.006 4.462 ↓ 0.0 0 1

Sort (cost=61.83..61.84 rows=1 width=36) (actual time=4.460..4.462 rows=0 loops=1)

  • Sort Key: sc1.snack_time_event_created_at
  • Sort Method: quicksort Memory: 25kB
4. 0.074 4.456 ↓ 0.0 0 1

Nested Loop (cost=1.23..61.82 rows=1 width=36) (actual time=4.455..4.456 rows=0 loops=1)

5. 0.229 1.323 ↓ 133.0 133 1

Nested Loop (cost=1.09..61.08 rows=1 width=98) (actual time=0.055..1.323 rows=133 loops=1)

6. 0.156 0.558 ↓ 134.0 134 1

Nested Loop Left Join (cost=0.29..59.26 rows=1 width=107) (actual time=0.043..0.558 rows=134 loops=1)

  • Join Filter: (ste1.slack_channel_id = sc1.id)
  • Rows Removed by Join Filter: 548
  • Filter: (ste1.id IS NULL)
  • Rows Removed by Filter: 4
7. 0.402 0.402 ↓ 1.8 138 1

Seq Scan on slack_channel sc1 (cost=0.00..55.78 rows=78 width=101) (actual time=0.026..0.402 rows=138 loops=1)

  • Filter: ((archived_at IS NULL) AND (deleted_at IS NULL) AND snack_time_enabled AND (NOT app_uninstalled) AND (participant_count > 0) AND (snack_time_event_created_at < (now() - '00:01:00'::interval)))
  • Rows Removed by Filter: 851
8. 0.000 0.000 ↓ 4.0 4 138

Materialize (cost=0.29..2.31 rows=1 width=14) (actual time=0.000..0.000 rows=4 loops=138)

9. 0.010 0.010 ↓ 4.0 4 1

Index Scan using snack_time_event_start_time_idx on snack_time_event ste1 (cost=0.29..2.30 rows=1 width=14) (actual time=0.008..0.010 rows=4 loops=1)

  • Index Cond: (start_time > now())
10. 0.268 0.536 ↑ 1.0 1 134

Bitmap Heap Scan on slack_team st1 (cost=0.80..1.81 rows=1 width=15) (actual time=0.004..0.004 rows=1 loops=134)

  • Recheck Cond: (id = sc1.slack_team_id)
  • Filter: ((chargebee_subscription_id IS NOT NULL) OR license_exception OR (sc1.name = 'snack-club'::text))
  • Rows Removed by Filter: 0
  • Heap Blocks: exact=134
11. 0.268 0.268 ↑ 1.0 1 134

Bitmap Index Scan on slack_team_pkey (cost=0.00..0.80 rows=1 width=0) (actual time=0.002..0.002 rows=1 loops=134)

  • Index Cond: (id = sc1.slack_team_id)
12. 3.059 3.059 ↓ 0.0 0 133

Index Scan using timezone_pkey on timezone t1 (cost=0.14..0.73 rows=1 width=25) (actual time=0.023..0.023 rows=0 loops=133)

  • Index Cond: (id = sc1.snack_time_timezone_id)
  • Filter: (((date_part('isodow'::text, timezone(name, now())))::integer = ANY (sc1.target_dows)) AND ((find_nearest_time(sc1.snack_times, sc1.target_dows, name) - now()) >= '00:05:00'::interval) AND ((find_nearest_time(sc1.snack_times, sc1.target_dows, name) - now()) <= '00:10:00'::interval))
  • Rows Removed by Filter: 1
Planning time : 0.987 ms
Execution time : 4.542 ms