explain.depesz.com

PostgreSQL's explain analyze made readable

Result: sGOl

Settings
# exclusive inclusive rows x rows loops node
1. 0.113 0.470 ↑ 1.0 7 1

GroupAggregate (cost=0.70..781.44 rows=7 width=269) (actual time=0.117..0.470 rows=7 loops=1)

  • Output: l.locker_manager_id, l.team_name, l.open_at, l.close_at, l.created_at, l.updated_at, l.markup, l.discount, l.need_help_with_logo, l.need_help_with_logo_desc, l.approved, l.roster_id, l.cancelled, l.custom_sport_name, l.autorelaunch, l.store_flyer, l.slug, l.locker_type, (l.team_neutral_color_ids <> '{}'::text[]), CASE WHEN ((l.approved IS FALSE) OR (l.open_at > now())) THEN 'draft'::text WHEN ((l.open_at < now()) AND ((l.close_at IS NULL) OR (l.close_at > now())) AND l.approved) THEN 'active'::text WHEN ((l.close_at < now()) AND l.approved) THEN 'closed'::text ELSE NULL::text END, count(css.id), l.id
  • Group Key: l.id
  • Buffers: shared hit=84
2. 0.143 0.357 ↓ 1.2 368 1

Nested Loop Left Join (cost=0.70..779.66 rows=310 width=255) (actual time=0.027..0.357 rows=368 loops=1)

  • Output: l.id, l.locker_manager_id, l.team_name, l.open_at, l.close_at, l.created_at, l.updated_at, l.markup, l.discount, l.need_help_with_logo, l.need_help_with_logo_desc, l.approved, l.roster_id, l.cancelled, l.custom_sport_name, l.autorelaunch, l.store_flyer, l.slug, l.locker_type, l.team_neutral_color_ids, css.id
  • Buffers: shared hit=84
3. 0.039 0.039 ↑ 1.0 7 1

Index Scan using lockers_pkey on public.lockers l (cost=0.28..39.27 rows=7 width=251) (actual time=0.014..0.039 rows=7 loops=1)

  • Output: l.locker_manager_id, l.team_name, l.open_at, l.close_at, l.created_at, l.updated_at, l.markup, l.discount, l.need_help_with_logo, l.need_help_with_logo_desc, l.approved, l.roster_id, l.cancelled, l.custom_sport_name, l.autorelaunch, l.store_flyer, l.slug, l.locker_type, l.team_neutral_color_ids, l.id
  • Index Cond: (l.id = ANY ('{101,102,103,104,105,106,107}'::integer[]))
  • Filter: (NOT l.cancelled)
  • Buffers: shared hit=21
4. 0.175 0.175 ↑ 1.2 53 7

Index Scan using index_colored_style_selections_on_locker_id on public.colored_style_selections css (cost=0.42..105.14 rows=63 width=8) (actual time=0.007..0.025 rows=53 loops=7)

  • Output: css.id, css.locker_id, css.colored_style_id, css.essential, css.created_at, css.updated_at, css.logo_id, css.status, css.deleted_at, css.cached_image
  • Index Cond: (css.locker_id = l.id)
  • Buffers: shared hit=63