explain.depesz.com

PostgreSQL's explain analyze made readable

Result: XCUt : with acl_read

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 2,137.282 ↓ 0.0 0 1

Limit (cost=0.26..1,278,124.57 rows=1 width=1,275) (actual time=2,137.282..2,137.282 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=134782
2.          

Initplan (for Limit)

3. 7.728 7.728 ↑ 1.0 1 1

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

  • Output: app.is_superbizon()
  • Buffers: shared hit=5257
4. 50.259 2,137.281 ↓ 0.0 0 1

Seq Scan on org."user" t (cost=0.00..1,278,124.31 rows=1 width=1,275) (actual time=2,137.281..2,137.281 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=134782
5.          

SubPlan (for Seq Scan)

6. 2,068.220 2,068.220 ↓ 0.0 0 9,401

Index Only Scan using v_rls_acl_idx_for_read on org.v_rls_acl_read acl (cost=0.42..130.82 rows=1 width=0) (actual time=0.220..0.220 rows=0 loops=9,401)

  • Index Cond: ((acl.role_organization_id = t.lead_organization_id) AND (acl.resource = 'user'::text))
  • Filter: (((acl.role_rowrole)::name = CURRENT_USER) AND (acl.user_id = app.get_session_user_id()))
  • Rows Removed by Filter: 582
  • Heap Fetches: 0
  • Buffers: shared hit=91594
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.323 ms
Execution time : 2,137.380 ms