explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 2r8t

Settings
# exclusive inclusive rows x rows loops node
1. 0.008 0.103 ↑ 1.3 3 1

HashAggregate (cost=11.86..11.90 rows=4 width=65) (actual time=0.102..0.103 rows=3 loops=1)

  • Group Key: ($0), ('{}'::text[]), ('{}'::bytea[])
2. 0.003 0.095 ↑ 1.3 3 1

Append (cost=2.36..11.83 rows=4 width=65) (actual time=0.035..0.095 rows=3 loops=1)

3. 0.001 0.034 ↑ 1.0 1 1

Result (cost=2.36..2.37 rows=1 width=65) (actual time=0.034..0.034 rows=1 loops=1)

4.          

Initplan (for Result)

5. 0.033 0.033 ↑ 1.0 1 1

Index Only Scan using users_admin_groups_pkey on users_admin_groups (cost=0.14..2.36 rows=1 width=0) (actual time=0.033..0.033 rows=1 loops=1)

  • Index Cond: ((company_id = '\x50613a5da3815e1953543666'::bytea) AND (user_id = '\x5ecb8bcdf92ea1055f7c662a'::bytea))
  • Heap Fetches: 1
6. 0.006 0.050 ↑ 1.0 2 1

GroupAggregate (cost=6.89..6.93 rows=2 width=49) (actual time=0.050..0.050 rows=2 loops=1)

  • Group Key: users_permission_groups.permissions
7. 0.009 0.044 ↓ 1.7 5 1

Sort (cost=6.89..6.89 rows=3 width=29) (actual time=0.043..0.044 rows=5 loops=1)

  • Sort Key: users_permission_groups.permissions
  • Sort Method: quicksort Memory: 25kB
8. 0.005 0.035 ↓ 1.7 5 1

Nested Loop (cost=0.27..6.86 rows=3 width=29) (actual time=0.023..0.035 rows=5 loops=1)

9. 0.015 0.015 ↓ 1.2 5 1

Index Only Scan using users_groups_to_users_association_pkey on users_groups_to_users_association (cost=0.13..3.51 rows=4 width=26) (actual time=0.013..0.015 rows=5 loops=1)

  • Index Cond: ((company_id = '\x50613a5da3815e1953543666'::bytea) AND (user_id = '\x5ecb8bcdf92ea1055f7c662a'::bytea))
  • Heap Fetches: 5
10. 0.015 0.015 ↑ 1.0 1 5

Index Scan using users_permission_groups_pkey on users_permission_groups (cost=0.13..0.98 rows=1 width=42) (actual time=0.003..0.003 rows=1 loops=5)

  • Index Cond: ((company_id = '\x50613a5da3815e1953543666'::bytea) AND (group_id = users_groups_to_users_association.group_id))
11. 0.008 0.008 ↓ 0.0 0 1

Index Scan using users_permissions_pkey on users_permissions (cost=0.27..2.49 rows=1 width=87) (actual time=0.008..0.008 rows=0 loops=1)

  • Index Cond: ((company_id = '\x50613a5da3815e1953543666'::bytea) AND (user_id = '\x5ecb8bcdf92ea1055f7c662a'::bytea))
Planning time : 0.344 ms
Execution time : 0.183 ms