QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Unique (cost=101.98..102.03 rows=5 width=56) (actual time=3049.469..3049.479 rows=1 loops=1) -> Sort (cost=101.98..101.99 rows=5 width=56) (actual time=3049.461..3049.465 rows=1 loops=1) Sort Key: rbac_project_path_string, rbac_resource_name, rbac_resource_value -> Append (cost=0.00..101.92 rows=5 width=56) (actual time=2101.795..3049.325 rows=1 loops=1) -> Nested Loop (cost=0.00..13.35 rows=1 width=56) (actual time=505.275..505.275 rows=0 loops=1) -> Nested Loop (cost=0.00..12.97 rows=1 width=30) (actual time=505.268..505.268 rows=0 loops=1) -> Nested Loop (cost=0.00..8.68 rows=1 width=42) (actual time=0.347..346.759 rows=7294 loops=1) -> Index Scan using role_oper_obj_oper on role_operation (cost=0.00..4.40 rows=1 width=30) (actual time=0.235..71.840 rows=7294 loops=1) Index Cond: (((object_type_id)::text = 'Scm.Repository'::text) AND ((operation_category)::text = 'use'::text) AND ((operation_name)::text = 'access'::text)) -> Index Scan using role_pk on "role" (cost=0.00..4.27 rows=1 width=12) (actual time=0.020..0.024 rows=1 loops=7294) Index Cond: (("role".id)::text = (role_operation.role_id)::text) Filter: (NOT is_deleted) -> Index Scan using role_def_u_prj_idx on role_default_user (cost=0.00..4.27 rows=1 width=24) (actual time=0.015..0.015 rows=0 loops=7294) Index Cond: ((("role".id)::text = (role_default_user.role_id)::text) AND (role_default_user.default_user_class_id = 1)) -> Index Scan using project_pk on project (cost=0.00..0.37 rows=1 width=50) (never executed) Index Cond: ((role_default_user.project_id)::text = (project.id)::text) Filter: (((path)::text = 'projects.barnes_and_nobles_college_bookse_3'::text) AND (NOT is_deleted)) -> Nested Loop (cost=0.00..13.35 rows=1 width=56) (actual time=442.680..442.680 rows=0 loops=1) -> Nested Loop (cost=0.00..12.97 rows=1 width=30) (actual time=442.674..442.674 rows=0 loops=1) -> Nested Loop (cost=0.00..8.68 rows=1 width=42) (actual time=0.124..289.008 rows=7294 loops=1) -> Index Scan using role_oper_obj_oper on role_operation (cost=0.00..4.40 rows=1 width=30) (actual time=0.093..35.719 rows=7294 loops=1) Index Cond: (((object_type_id)::text = 'Scm.Repository'::text) AND ((operation_category)::text = 'use'::text) AND ((operation_name)::text = 'access'::text)) -> Index Scan using role_pk on "role" (cost=0.00..4.27 rows=1 width=12) (actual time=0.018..0.021 rows=1 loops=7294) Index Cond: (("role".id)::text = (role_operation.role_id)::text) Filter: (NOT is_deleted) -> Index Scan using role_def_u_prj_idx on role_default_user (cost=0.00..4.27 rows=1 width=24) (actual time=0.014..0.014 rows=0 loops=7294) Index Cond: ((("role".id)::text = (role_default_user.role_id)::text) AND (role_default_user.default_user_class_id = 2)) -> Index Scan using project_pk on project (cost=0.00..0.37 rows=1 width=50) (never executed) Index Cond: ((role_default_user.project_id)::text = (project.id)::text) Filter: (((path)::text = 'projects.barnes_and_nobles_college_bookse_3'::text) AND (NOT is_deleted)) -> Nested Loop (cost=0.00..13.35 rows=1 width=56) (actual time=184.063..184.063 rows=0 loops=1) -> Nested Loop (cost=0.00..9.07 rows=1 width=80) (actual time=184.055..184.055 rows=0 loops=1) -> Nested Loop (cost=0.00..8.69 rows=1 width=54) (actual time=8.814..183.848 rows=4 loops=1) -> Index Scan using role_oper_obj_oper on role_operation (cost=0.00..4.40 rows=1 width=30) (actual time=0.095..34.567 rows=7294 loops=1) Index Cond: (((object_type_id)::text = 'Scm.Repository'::text) AND ((operation_category)::text = 'use'::text) AND ((operation_name)::text = 'access'::text)) -> Index Scan using role_def_u_prj_idx on role_default_user (cost=0.00..4.27 rows=1 width=24) (actual time=0.014..0.014 rows=0 loops=7294) Index Cond: (((role_operation.role_id)::text = (role_default_user.role_id)::text) AND (role_default_user.default_user_class_id = 3)) -> Index Scan using project_pk on project (cost=0.00..0.37 rows=1 width=50) (actual time=0.042..0.042 rows=0 loops=4) Index Cond: ((role_default_user.project_id)::text = (project.id)::text) Filter: (((path)::text = 'projects.barnes_and_nobles_college_bookse_3'::text) AND (NOT is_deleted)) -> Index Scan using role_pk on "role" (cost=0.00..4.27 rows=1 width=12) (never executed) Index Cond: (("role".id)::text = (role_default_user.role_id)::text) Filter: (NOT is_deleted) -> Nested Loop (cost=0.00..16.02 rows=1 width=56) (actual time=202.991..202.991 rows=0 loops=1) -> Nested Loop (cost=0.00..15.73 rows=1 width=42) (actual time=202.984..202.984 rows=0 loops=1) -> Nested Loop (cost=0.00..11.45 rows=1 width=66) (actual time=202.978..202.978 rows=0 loops=1) Join Filter: ((projectmembership.member_id)::text = (sfuser.id)::text) -> Nested Loop (cost=0.00..10.13 rows=4 width=78) (actual time=10.425..190.540 rows=437 loops=1) -> Nested Loop (cost=0.00..8.69 rows=1 width=54) (actual time=8.747..182.982 rows=10 loops=1) -> Index Scan using role_oper_obj_oper on role_operation (cost=0.00..4.40 rows=1 width=30) (actual time=0.093..34.379 rows=7294 loops=1) Index Cond: (((object_type_id)::text = 'Scm.Repository'::text) AND ((operation_category)::text = 'use'::text) AND ((operation_name)::text = 'access'::text)) -> Index Scan using role_def_u_prj_idx on role_default_user (cost=0.00..4.27 rows=1 width=24) (actual time=0.014..0.014 rows=0 loops=7294) Index Cond: (((role_operation.role_id)::text = (role_default_user.role_id)::text) AND (role_default_user.default_user_class_id = 4)) -> Index Scan using pjmb_projmember on projectmembership (cost=0.00..1.13 rows=25 width=24) (actual time=0.053..0.453 rows=44 loops=10) Index Cond: ((role_default_user.project_id)::text = (projectmembership.project_id)::text) -> Index Scan using sfuser_username on sfuser (cost=0.00..0.32 rows=1 width=12) (actual time=0.014..0.018 rows=1 loops=437) Index Cond: ((username)::text = 'rtrejo'::text) -> Index Scan using role_pk on "role" (cost=0.00..4.27 rows=1 width=12) (never executed) Index Cond: (("role".id)::text = (role_default_user.role_id)::text) Filter: (NOT is_deleted) -> Index Scan using project_pk on project (cost=0.00..0.28 rows=1 width=50) (never executed) Index Cond: ((role_default_user.project_id)::text = (project.id)::text) Filter: (((path)::text = 'projects.barnes_and_nobles_college_bookse_3'::text) AND (NOT is_deleted)) -> Nested Loop (cost=2.40..45.80 rows=1 width=56) (actual time=766.764..1714.288 rows=1 loops=1) Join Filter: ((role_user.user_id)::text = (sfuser.id)::text) -> Nested Loop (cost=2.40..45.49 rows=1 width=68) (actual time=762.629..1712.222 rows=82 loops=1) -> Nested Loop (cost=2.40..44.63 rows=3 width=42) (actual time=0.356..944.773 rows=37814 loops=1) -> Nested Loop (cost=0.00..8.68 rows=1 width=42) (actual time=0.134..272.836 rows=7294 loops=1) -> Index Scan using role_oper_obj_oper on role_operation (cost=0.00..4.40 rows=1 width=30) (actual time=0.098..34.408 rows=7294 loops=1) Index Cond: (((object_type_id)::text = 'Scm.Repository'::text) AND ((operation_category)::text = 'use'::text) AND ((operation_name)::text = 'access'::text)) -> Index Scan using role_pk on "role" (cost=0.00..4.27 rows=1 width=12) (actual time=0.016..0.019 rows=1 loops=7294) Index Cond: (("role".id)::text = (role_operation.role_id)::text) Filter: (NOT is_deleted) -> Bitmap Heap Scan on role_user (cost=2.40..35.73 rows=18 width=36) (actual time=0.029..0.050 rows=5 loops=7294) Recheck Cond: (("role".id)::text = (role_user.role_id)::text) -> Bitmap Index Scan on role_user_proj_idx (cost=0.00..2.39 rows=18 width=0) (actual time=0.021..0.021 rows=5 loops=7294) Index Cond: (("role".id)::text = (role_user.role_id)::text) -> Index Scan using project_pk on project (cost=0.00..0.27 rows=1 width=50) (actual time=0.014..0.014 rows=0 loops=37814) Index Cond: ((role_user.project_id)::text = (project.id)::text) Filter: (((path)::text = 'projects.barnes_and_nobles_college_bookse_3'::text) AND (NOT is_deleted)) -> Index Scan using sfuser_username on sfuser (cost=0.00..0.30 rows=1 width=12) (actual time=0.012..0.015 rows=1 loops=82) Index Cond: ((username)::text = 'rtrejo'::text) Total runtime: 3050.582 ms (83 rows)