explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Fye4

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

ProjectSet (cost=257.86..430.45 rows=1,000 width=245) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on hierarchy_entity h (cost=257.86..425.19 rows=1 width=450) (actual rows= loops=)

  • Recheck Cond: (org_id = (current_setting('jwt.claims.org_id'::text, true))::integer)
  • Filter: (((creator_id = (current_setting('jwt.claims.user_id'::text, true))::integer) OR (hashed SubPlan 1)) AND ((((((((current_setting('jwt.claims.data'::text, true))::json -> 'permission'::text) -> 'access'::text) -> 'hierarchy_entity'::text))::text)::integer IS NULL) OR ((((((((current_setting('jwt.claims.data'::text, true))::json -> 'permission'::text) -> 'access'::text) -> 'hierarchy_entity'::text))::text)::integer & 1) = 1)) AND ((((((((current_setting('jwt.claims.data'::text, true))::json -> 'permission'::text) -> 'access'::text) -> 'all'::text))::text)::integer IS NULL) OR ((((((((current_setting('jwt.claims.data'::text, true))::json -> 'permission'::text) -> 'access'::text) -> 'all'::text))::text)::integer & 1) = 1)))
3. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on hierarchy_entity_org_id_level_index (cost=0.00..6.31 rows=269 width=0) (actual rows= loops=)

  • Index Cond: (org_id = (current_setting('jwt.claims.org_id'::text, true))::integer)
4.          

SubPlan (forBitmap Heap Scan)

5. 0.000 0.000 ↓ 0.0

Index Scan using user_client_id_index on "user" (cost=0.29..251.55 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (client_id = (current_setting('jwt.claims.client_id'::text, true))::integer)
  • Filter: (((role)::text = 'client_admin'::text) AND ((((((((((current_setting('jwt.claims.data'::text, true))::json -> 'permission'::text) -> 'access'::text) -> 'user'::text))::text)::integer IS NULL) OR ((((((((current_setting('jwt.claims.data'::text, true))::json -> 'permission'::text) -> 'access'::text) -> 'user'::text))::text)::integer & 1) = 1)) AND ((((((((current_setting('jwt.claims.data'::text, true))::json -> 'permission'::text) -> 'access'::text) -> 'all'::text))::text)::integer IS NULL) OR ((((((((current_setting('jwt.claims.data'::text, true))::json -> 'permission'::text) -> 'access'::text) -> 'all'::text))::text)::integer & 1) = 1)) AND (id = (current_setting('jwt.claims.user_id'::text, true))::integer) AND ((role)::text = 'org_admin'::text)) OR ((client_id = (current_setting('jwt.claims.client_id'::text, true))::integer) AND ((role)::text = 'client_admin'::text)) OR (((((((((current_setting('jwt.claims.data'::text, true))::json -> 'permission'::text) -> 'access'::text) -> 'user'::text))::text)::integer IS NULL) OR ((((((((current_setting('jwt.claims.data'::text, true))::json -> 'permission'::text) -> 'access'::text) -> 'user'::text))::text)::integer & 1) = 1)) AND ((((((((current_setting('jwt.claims.data'::text, true))::json -> 'permission'::text) -> 'access'::text) -> 'all'::text))::text)::integer IS NULL) OR ((((((((current_setting('jwt.claims.data'::text, true))::json -> 'permission'::text) -> 'access'::text) -> 'all'::text))::text)::integer & 1) = 1)) AND (org_id = (current_setting('jwt.claims.org_id'::text, true))::integer))))