explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Ynhi

Settings
# exclusive inclusive rows x rows loops node
1. 0.450 93.948 ↓ 2.6 614 1

HashAggregate (cost=61.52..63.84 rows=232 width=23) (actual time=93.802..93.948 rows=614 loops=1)

  • Group Key: permissions.id
2. 0.981 93.498 ↓ 2.6 614 1

Nested Loop (cost=10.58..60.94 rows=232 width=23) (actual time=0.114..93.498 rows=614 loops=1)

  • Join Filter: ((user_roles.role_id)::text = (roles.id)::text)
  • Rows Removed by Join Filter: 4912
3. 0.015 0.015 ↓ 9.0 9 1

Seq Scan on roles (cost=0.00..1.09 rows=1 width=146) (actual time=0.010..0.015 rows=9 loops=1)

  • Filter: (deleted_at IS NULL)
4. 1.089 92.502 ↓ 9.7 614 9

Nested Loop (cost=10.58..59.07 rows=63 width=179) (actual time=0.081..10.278 rows=614 loops=9)

5. 1.359 2.997 ↓ 9.7 614 9

Nested Loop (cost=10.30..38.59 rows=63 width=178) (actual time=0.061..0.333 rows=614 loops=9)

6. 0.063 0.063 ↑ 1.0 1 9

Seq Scan on user_roles (cost=0.00..1.41 rows=1 width=146) (actual time=0.003..0.007 rows=1 loops=9)

  • Filter: (user_id = '90dea221-0199-4e9f-84da-87aa5e186d4e'::uuid)
  • Rows Removed by Filter: 32
7. 1.143 1.575 ↓ 2.4 614 9

Bitmap Heap Scan on role_permissions (cost=10.30..34.57 rows=261 width=32) (actual time=0.053..0.175 rows=614 loops=9)

  • Recheck Cond: ((role_id)::text = (user_roles.role_id)::text)
  • Heap Blocks: exact=108
8. 0.432 0.432 ↓ 2.4 614 9

Bitmap Index Scan on role_permissions_role_id_index (cost=0.00..10.24 rows=261 width=0) (actual time=0.048..0.048 rows=614 loops=9)

  • Index Cond: ((role_id)::text = (user_roles.role_id)::text)
9. 88.416 88.416 ↑ 1.0 1 5,526

Index Scan using permissions_pkey on permissions (cost=0.28..0.33 rows=1 width=23) (actual time=0.016..0.016 rows=1 loops=5,526)

  • Index Cond: ((id)::text = (role_permissions.permission_id)::text)
  • Filter: (deleted_at IS NULL)
Planning time : 1.402 ms
Execution time : 94.098 ms