-
Suggestion
-
Resolution: Unresolved
-
None
-
1
-
Problem Definition
Table projectroleactor is used for storing project level permissions, example:
select * from projectroleactor; id | pid | projectroleid | roletype | roletypeparameter -------+-------+---------------+----------------------------+--------------------- 10000 | | 10000 | atlassian-group-role-actor | jira-users 10001 | | 10001 | atlassian-group-role-actor | jira-developers 10002 | | 10002 | atlassian-group-role-actor | jira-administrators 10106 | 10001 | 10000 | atlassian-group-role-actor | jira-users 10107 | 10001 | 10002 | atlassian-group-role-actor | jira-administrators 11300 | 10800 | 10002 | atlassian-group-role-actor | jira-administrators 11301 | 10800 | 10001 | atlassian-group-role-actor | jira-developers 11303 | 10800 | 10000 | atlassian-group-role-actor | jira-administrators 11703 | 11000 | 10002 | atlassian-user-role-actor | admin ...
Table config:
\d projectroleactor; Table "public.projectroleactor" Column | Type | Modifiers -------------------+------------------------+----------- id | numeric(18,0) | not null pid | numeric(18,0) | projectroleid | numeric(18,0) | roletype | character varying(255) | roletypeparameter | character varying(255) | Indexes: "pk_projectroleactor" PRIMARY KEY, btree (id) "role_pid_idx" btree (pid) "role_player_idx" btree (projectroleid, pid)
- Columns ROLETYPE and ROLETYPEPARAMETER is being used during data loading in getProjectIdsContainingRoleActorByKeyAndType
- which is used in API getProjectIdsContainingRoleActorByNameAndType
- and it's being used in ViewUserProjectRoles page (URL: secure/admin/user/ViewUserProjectRoles!default.jspa)
Produced SQL:
2019-09-23 19:37:19,973 http-nio-8080-exec-5 admin 1176x480x1 vphgel /secure/admin/user/ViewUserProjectRoles!default.jspa 2ms "SELECT DISTINCT PID FROM public.projectroleactor WHERE ROLETYPE='atlassian-user-role-actor' AND ROLETYPEPARAMETER='admin'"
Suggested Solution
Add an extra cover index (ROLETYPEPARAMETER, ROLETYPE, ID) (in that order since ROLETYPE has only 2 values) to the table to reduce DB load and improve loading time.
Workaround
Add index manually.
- Example for MSSQL
CREATE NONCLUSTERED INDEX [idx_role_type_param_pid] ON [dbo].[projectroleactor] ([ROLETYPEPARAMETER], [ROLETYPE], [ID])
- is cloned from
-
JRASERVER-70002 Add COLUMNLAYOUT index to the columnlayoutitem table
- Closed
- relates to
-
JRASERVER-69446 Removing actor from project role can make Jira unresponsive
-
- Closed
-
[JRASERVER-70003] Add role_type_param_pid index to the projectroleactor table
Description |
Original:
h3. Problem Definition
Table {{projectroleactor}} is used for storing project level permissions, example: {noformat} select * from projectroleactor; id | pid | projectroleid | roletype | roletypeparameter -------+-------+---------------+----------------------------+--------------------- 10000 | | 10000 | atlassian-group-role-actor | jira-users 10001 | | 10001 | atlassian-group-role-actor | jira-developers 10002 | | 10002 | atlassian-group-role-actor | jira-administrators 10106 | 10001 | 10000 | atlassian-group-role-actor | jira-users 10107 | 10001 | 10002 | atlassian-group-role-actor | jira-administrators 11300 | 10800 | 10002 | atlassian-group-role-actor | jira-administrators 11301 | 10800 | 10001 | atlassian-group-role-actor | jira-developers 11303 | 10800 | 10000 | atlassian-group-role-actor | jira-administrators 11703 | 11000 | 10002 | atlassian-user-role-actor | admin ... {noformat} Table config: {noformat} \d projectroleactor; Table "public.projectroleactor" Column | Type | Modifiers -------------------+------------------------+----------- id | numeric(18,0) | not null pid | numeric(18,0) | projectroleid | numeric(18,0) | roletype | character varying(255) | roletypeparameter | character varying(255) | Indexes: "pk_projectroleactor" PRIMARY KEY, btree (id) "role_pid_idx" btree (pid) "role_player_idx" btree (projectroleid, pid) {noformat} * Columns {{ROLETYPE}} and {{ROLETYPEPARAMETER}} is being used during data loading in *getProjectIdsContainingRoleActorByKeyAndType* * which is used in API *getProjectIdsContainingRoleActorByNameAndType* * and it's being used in *ViewUserProjectRoles* page (URL: secure/admin/user/ViewUserProjectRoles!default.jspa) Produced SQL: {noformat} 2019-09-23 19:37:19,973 http-nio-8080-exec-5 admin 1176x480x1 vphgel /secure/admin/user/ViewUserProjectRoles!default.jspa 2ms "SELECT DISTINCT PID FROM public.projectroleactor WHERE ROLETYPE='atlassian-user-role-actor' AND ROLETYPEPARAMETER='admin'" {noformat} h3. Suggested Solution Add an extra cover index (ROLETYPEPARAMETER, ROLETYPE, ID) (in that order since _ROLETYPE_ has only 2 values) to the table to reduce DB load and improve loading time. h3. Workaround Add index manually. * Example for MSSQL {code:sql|borderStyle=solid} CREATE NONCLUSTERED INDEX [idx_role_type_param_pid] ON [dbo].[projectroleactor] ([ROLETYPEPARAMETER], [ROLETYPE], [PID]) {code} |
New:
h3. Problem Definition
Table {{projectroleactor}} is used for storing project level permissions, example: {noformat} select * from projectroleactor; id | pid | projectroleid | roletype | roletypeparameter -------+-------+---------------+----------------------------+--------------------- 10000 | | 10000 | atlassian-group-role-actor | jira-users 10001 | | 10001 | atlassian-group-role-actor | jira-developers 10002 | | 10002 | atlassian-group-role-actor | jira-administrators 10106 | 10001 | 10000 | atlassian-group-role-actor | jira-users 10107 | 10001 | 10002 | atlassian-group-role-actor | jira-administrators 11300 | 10800 | 10002 | atlassian-group-role-actor | jira-administrators 11301 | 10800 | 10001 | atlassian-group-role-actor | jira-developers 11303 | 10800 | 10000 | atlassian-group-role-actor | jira-administrators 11703 | 11000 | 10002 | atlassian-user-role-actor | admin ... {noformat} Table config: {noformat} \d projectroleactor; Table "public.projectroleactor" Column | Type | Modifiers -------------------+------------------------+----------- id | numeric(18,0) | not null pid | numeric(18,0) | projectroleid | numeric(18,0) | roletype | character varying(255) | roletypeparameter | character varying(255) | Indexes: "pk_projectroleactor" PRIMARY KEY, btree (id) "role_pid_idx" btree (pid) "role_player_idx" btree (projectroleid, pid) {noformat} * Columns {{ROLETYPE}} and {{ROLETYPEPARAMETER}} is being used during data loading in *getProjectIdsContainingRoleActorByKeyAndType* * which is used in API *getProjectIdsContainingRoleActorByNameAndType* * and it's being used in *ViewUserProjectRoles* page (URL: secure/admin/user/ViewUserProjectRoles!default.jspa) Produced SQL: {noformat} 2019-09-23 19:37:19,973 http-nio-8080-exec-5 admin 1176x480x1 vphgel /secure/admin/user/ViewUserProjectRoles!default.jspa 2ms "SELECT DISTINCT PID FROM public.projectroleactor WHERE ROLETYPE='atlassian-user-role-actor' AND ROLETYPEPARAMETER='admin'" {noformat} h3. Suggested Solution Add an extra cover index (ROLETYPEPARAMETER, ROLETYPE, ID) (in that order since _ROLETYPE_ has only 2 values) to the table to reduce DB load and improve loading time. h3. Workaround Add index manually. * Example for MSSQL {code:sql|borderStyle=solid} CREATE NONCLUSTERED INDEX [idx_role_type_param_pid] ON [dbo].[projectroleactor] ([ROLETYPEPARAMETER], [ROLETYPE], [ID]) {code} |
UIS | Original: 0 | New: 1 |
UIS | Original: 1 | New: 0 |
UIS | Original: 2 | New: 1 |
UIS | Original: 1 | New: 2 |
Remote Link | New: This issue links to "Page (Confluence)" [ 633505 ] |
Remote Link | New: This issue links to "Page (Confluence)" [ 589492 ] |
Labels | Original: database pse-request | New: database database-index pse-request |
Link |
New:
This issue relates to |
UIS | Original: 2 | New: 1 |