explain.depesz.com

PostgreSQL's explain analyze made readable

Result: haF6

Settings
# exclusive inclusive rows x rows loops node
1. 2.383 11.245 ↓ 20.2 1,290 1

HashAggregate (cost=572.60..573.24 rows=64 width=2,126) (actual time=10.572..11.245 rows=1,290 loops=1)

  • Group Key: members.id, members.access_level, members.source_id, members.source_type, members.user_id, members.notification_level, members.type, members.created_at, members.updated_at, members.created_by_id, members.invite_email, members.invite_token, members.invite_accepted_at, members.requested_at, members.expires_at, members.ldap, members.override
  • Buffers: shared hit=6,373
2. 0.215 8.862 ↓ 20.2 1,290 1

Append (cost=0.99..569.88 rows=64 width=2,126) (actual time=0.058..8.862 rows=1,290 loops=1)

  • Buffers: shared hit=6,373
3. 1.435 8.635 ↓ 20.5 1,290 1

Nested Loop (cost=0.99..561.99 rows=63 width=168) (actual time=0.058..8.635 rows=1,290 loops=1)

  • Buffers: shared hit=6,371
4. 2.024 2.024 ↓ 20.2 1,294 1

Index Scan using index_members_on_source_id_and_source_type on public.members (cost=0.56..341.03 rows=64 width=168) (actual time=0.040..2.024 rows=1,294 loops=1)

  • Index Cond: ((members.source_id = 9,970) AND ((members.source_type)::text = 'Namespace'::text))
  • Filter: ((members.requested_at IS NULL) AND (members.invite_token IS NULL) AND (members.access_level > 5) AND (members.access_level > 5) AND ((members.type)::text = 'GroupMember'::text))
  • Rows Removed by Filter: 2
  • Buffers: shared hit=1,195
5. 5.176 5.176 ↑ 1.0 1 1,294

Index Scan using users_pkey on public.users (cost=0.43..3.45 rows=1 width=4) (actual time=0.004..0.004 rows=1 loops=1,294)

  • Index Cond: (users.id = members.user_id)
  • Filter: ((users.state)::text = 'active'::text)
  • Rows Removed by Filter: 0
  • Buffers: shared hit=5,176
6. 0.000 0.012 ↓ 0.0 0 1

Nested Loop (cost=3.86..6.92 rows=1 width=168) (actual time=0.012..0.012 rows=0 loops=1)

  • Buffers: shared hit=2
7.          

CTE group_group_links_cte

8. 0.010 0.010 ↓ 0.0 0 1

Index Scan using index_group_group_links_on_shared_group_and_shared_with_group on public.group_group_links group_group_links_1 (cost=0.28..3.30 rows=1 width=46) (actual time=0.010..0.010 rows=0 loops=1)

  • Index Cond: (group_group_links_1.shared_group_id = 9,970)
  • Buffers: shared hit=2
9. 0.012 0.012 ↓ 0.0 0 1

CTE Scan on group_group_links_cte group_group_links (cost=0.00..0.02 rows=1 width=10) (actual time=0.012..0.012 rows=0 loops=1)

  • Buffers: shared hit=2
10. 0.000 0.000 ↓ 0.0 0 0

Index Scan using index_members_on_source_id_and_source_type on public.members members_1 (cost=0.56..3.59 rows=1 width=168) (actual time=0.000..0.000 rows=0 loops=0)

  • Index Cond: ((members_1.source_id = group_group_links.shared_with_group_id) AND ((members_1.source_type)::text = 'Namespace'::text))
  • Filter: ((members_1.requested_at IS NULL) AND (members_1.access_level > 5) AND ((members_1.type)::text = 'GroupMember'::text))
  • Rows Removed by Filter: 0