explain.depesz.com

PostgreSQL's explain analyze made readable

Result: e27M

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 981.647 ↓ 0.0 0 1

Limit (cost=0.26..1,227,353.77 rows=1 width=1,275) (actual time=981.647..981.647 rows=0 loops=1)

  • Output: t.id, t.type, t.is_active, t.created_at, t.created_by, t.updated_at, t.updated_by, t.lead_organization_id, t.email, t.description, t.sso_id, t.phone, t.is_deleted, t.user_name, t.first_name, t.last_name, t.middle_name, t.extra_phone, t."position", t.culture_id, t.org_position
  • Buffers: shared hit=273179
2.          

Initplan (for Limit)

3. 7.669 7.669 ↑ 1.0 1 1

Result (cost=0.00..0.26 rows=1 width=1) (actual time=7.669..7.669 rows=1 loops=1)

  • Output: app.is_superbizon()
  • Buffers: shared hit=5257
4. 41.546 981.646 ↓ 0.0 0 1

Seq Scan on org."user" t (cost=0.00..1,227,353.51 rows=1 width=1,275) (actual time=981.646..981.646 rows=0 loops=1)

  • Output: t.id, t.type, t.is_active, t.created_at, t.created_by, t.updated_at, t.updated_by, t.lead_organization_id, t.email, t.description, t.sso_id, t.phone, t.is_deleted, t.user_name, t.first_name, t.last_name, t.middle_name, t.extra_phone, t."position", t.culture_id, t.org_position
  • Filter: ((NOT t.is_deleted) AND ($0 OR (t.id = app.get_session_user_id()) OR (SubPlan 2) OR (SubPlan 3)) AND (t.user_name = 'LoadTests_02_Child_0_User259'::citext))
  • Rows Removed by Filter: 9402
  • Buffers: shared hit=273179
5.          

SubPlan (for Seq Scan)

6. 921.298 921.298 ↓ 0.0 0 9,401

Index Only Scan using v_rls_acl_uidx_permission_v6 on org.v_rls_acl acl (cost=0.55..125.42 rows=1 width=0) (actual time=0.098..0.098 rows=0 loops=9,401)

  • Index Cond: ((acl.role_organization_id = t.lead_organization_id) AND (acl.resource = 'user'::text) AND (acl.action = 'R'::bpchar))
  • Filter: (((acl.role_rowrole)::name = CURRENT_USER) AND (acl.user_id = app.get_session_user_id()))
  • Rows Removed by Filter: 194
  • Heap Fetches: 0
  • Buffers: shared hit=229991
7. 18.802 18.802 ↓ 0.0 0 9,401

Index Only Scan using v_rls_acl_uidx_permission_v5 on org.v_rls_acl acl_1 (cost=0.55..4.82 rows=1 width=0) (actual time=0.002..0.002 rows=0 loops=9,401)

  • Index Cond: ((acl_1.role_organization_id = t.lead_organization_id) AND (acl_1.predefined_permissions = 'ALL'::text))
  • Filter: (((acl_1.role_rowrole)::name = CURRENT_USER) AND (acl_1.user_id = app.get_session_user_id()))
  • Rows Removed by Filter: 0
  • Heap Fetches: 0
  • Buffers: shared hit=37609
Planning time : 0.330 ms
Execution time : 981.719 ms