explain.depesz.com

PostgreSQL's explain analyze made readable

Result: HjbrJ

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 21.806 ↓ 0.0 0 1

Update on slack_channel sc2 (cost=62.12..64.14 rows=1 width=834) (actual time=21.801..21.806 rows=0 loops=1)

2.          

Initplan (for Update)

3. 0.002 21.797 ↓ 0.0 0 1

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

4. 0.000 21.795 ↓ 0.0 0 1

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

5. 0.026 21.795 ↓ 0.0 0 1

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

  • Sort Key: sc1.snack_time_event_created_at
  • Sort Method: quicksort Memory: 25kB
6. 0.066 21.769 ↓ 0.0 0 1

Nested Loop (cost=1.22..61.82 rows=1 width=36) (actual time=21.767..21.769 rows=0 loops=1)

7. 0.356 2.817 ↓ 133.0 133 1

Nested Loop (cost=1.08..61.08 rows=1 width=98) (actual time=0.072..2.817 rows=133 loops=1)

8. 0.428 0.853 ↓ 134.0 134 1

Nested Loop Left Join (cost=0.29..59.26 rows=1 width=107) (actual time=0.055..0.853 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
9. 0.425 0.425 ↓ 1.8 138 1

Seq Scan on slack_channel sc1 (cost=0.00..55.78 rows=78 width=101) (actual time=0.036..0.425 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
10. 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)

11. 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.009..0.010 rows=4 loops=1)

  • Index Cond: (start_time > now())
12. 0.268 1.608 ↑ 1.0 1 134

Bitmap Heap Scan on slack_team st1 (cost=0.80..1.81 rows=1 width=15) (actual time=0.012..0.012 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
13. 1.340 1.340 ↑ 1.0 1 134

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

  • Index Cond: (id = sc1.slack_team_id)
14. 18.886 18.886 ↓ 0.0 0 133

Index Scan using timezone_pkey on timezone t1 (cost=0.14..0.73 rows=1 width=25) (actual time=0.142..0.142 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
15. 21.800 21.800 ↓ 0.0 0 1

Index Scan using slack_channel_pkey on slack_channel sc2 (cost=0.28..2.29 rows=1 width=834) (actual time=21.800..21.800 rows=0 loops=1)

  • Index Cond: (id = $6)
Planning time : 2.703 ms
Execution time : 28.189 ms