explain.depesz.com

PostgreSQL's explain analyze made readable

Result: qSR4

Settings
# exclusive inclusive rows x rows loops node
1. 0.024 0.405 ↓ 11.8 47 1

Nested Loop (cost=1.28..35.11 rows=4 width=329) (actual time=0.158..0.405 rows=47 loops=1)

  • Output: users.id, users.created, users.updated, users.first_name, users.last_name, users.email, users.status, users.company_id, roles.id, roles.created, roles.updated, roles.role_name, roles.realm_id, permissions.id, permissions.created, permissions.updated, permissions.permission_name, permissions.realm_id, realm.id, realm.created, realm.updated, realm.realm_name, realm.redirect_uris, company.id, company.created, company.updated, company.company_name
  • Join Filter: (permissions.realm_id = realm.id)
  • Rows Removed by Join Filter: 74
2. 0.076 0.076 ↑ 1.0 1 1

Seq Scan on public.realm (cost=0.00..1.09 rows=1 width=110) (actual time=0.074..0.076 rows=1 loops=1)

  • Output: realm.id, realm.created, realm.updated, realm.realm_name, realm.redirect_uris
  • Filter: ((realm.realm_name)::text = 'dash26_einstein'::text)
  • Rows Removed by Filter: 8
3. 0.032 0.305 ↓ 4.3 121 1

Nested Loop (cost=1.28..33.67 rows=28 width=219) (actual time=0.082..0.305 rows=121 loops=1)

  • Output: users.id, users.created, users.updated, users.first_name, users.last_name, users.email, users.status, users.company_id, roles.id, roles.created, roles.updated, roles.role_name, roles.realm_id, permissions.id, permissions.created, permissions.updated, permissions.permission_name, permissions.realm_id, company.id, company.created, company.updated, company.company_name
  • Inner Unique: true
4. 0.031 0.152 ↓ 4.3 121 1

Nested Loop (cost=1.14..28.76 rows=28 width=178) (actual time=0.074..0.152 rows=121 loops=1)

  • Output: users.id, users.created, users.updated, users.first_name, users.last_name, users.email, users.status, users.company_id, roles.id, roles.created, roles.updated, roles.role_name, roles.realm_id, role_permission.permission_id, company.id, company.created, company.updated, company.company_name
  • Join Filter: (roles.id = role_permission.role_id)
5. 0.004 0.069 ↓ 2.0 4 1

Nested Loop (cost=0.85..27.31 rows=2 width=178) (actual time=0.060..0.069 rows=4 loops=1)

  • Output: users.id, users.created, users.updated, users.first_name, users.last_name, users.email, users.status, users.company_id, user_role.role_id, roles.id, roles.created, roles.updated, roles.role_name, roles.realm_id, company.id, company.created, company.updated, company.company_name
  • Inner Unique: true
6. 0.002 0.057 ↓ 2.0 4 1

Nested Loop (cost=0.71..26.98 rows=2 width=133) (actual time=0.053..0.057 rows=4 loops=1)

  • Output: users.id, users.created, users.updated, users.first_name, users.last_name, users.email, users.status, users.company_id, user_role.role_id, company.id, company.created, company.updated, company.company_name
7. 0.001 0.031 ↑ 1.0 1 1

Nested Loop Left Join (cost=0.43..16.48 rows=1 width=125) (actual time=0.030..0.031 rows=1 loops=1)

  • Output: users.id, users.created, users.updated, users.first_name, users.last_name, users.email, users.status, users.company_id, company.id, company.created, company.updated, company.company_name
  • Inner Unique: true
8. 0.021 0.021 ↑ 1.0 1 1

Index Scan using leibniz_user_email_idx on public.leibniz_user users (cost=0.28..8.30 rows=1 width=73) (actual time=0.020..0.021 rows=1 loops=1)

  • Output: users.id, users.created, users.updated, users.first_name, users.last_name, users.email, users.status, users.company_id
  • Index Cond: ((users.email)::text = 'aleksandr.sakharov@n26.com'::text)
  • Filter: (users.status = 'ACTIVE'::user_status_enum)
9. 0.009 0.009 ↑ 1.0 1 1

Index Scan using company_id_pkey on public.company (cost=0.15..8.17 rows=1 width=52) (actual time=0.009..0.009 rows=1 loops=1)

  • Output: company.id, company.created, company.updated, company.company_name
  • Index Cond: (company.id = users.company_id)
10. 0.024 0.024 ↓ 2.0 4 1

Index Scan using roles_users_leibniz_user_id_idx on public.roles_users user_role (cost=0.28..10.48 rows=2 width=16) (actual time=0.021..0.024 rows=4 loops=1)

  • Output: user_role.role_id, user_role.leibniz_user_id, user_role.created
  • Index Cond: (user_role.leibniz_user_id = users.id)
11. 0.008 0.008 ↑ 1.0 1 4

Index Scan using role_id_pkey on public.role roles (cost=0.14..0.17 rows=1 width=45) (actual time=0.002..0.002 rows=1 loops=4)

  • Output: roles.id, roles.created, roles.updated, roles.role_name, roles.realm_id
  • Index Cond: (roles.id = user_role.role_id)
12. 0.052 0.052 ↓ 2.1 30 4

Index Only Scan using roles_permissions_role_id_permission_id_pkey on public.roles_permissions role_permission (cost=0.28..0.55 rows=14 width=16) (actual time=0.005..0.013 rows=30 loops=4)

  • Output: role_permission.role_id, role_permission.permission_id
  • Index Cond: (role_permission.role_id = user_role.role_id)
  • Heap Fetches: 56
13. 0.121 0.121 ↑ 1.0 1 121

Index Scan using permission_id_pkey on public.permission permissions (cost=0.15..0.18 rows=1 width=49) (actual time=0.001..0.001 rows=1 loops=121)

  • Output: permissions.id, permissions.created, permissions.updated, permissions.permission_name, permissions.realm_id
  • Index Cond: (permissions.id = role_permission.permission_id)
Planning time : 2.570 ms
Execution time : 0.533 ms