Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-74154

Synchronization takes a long time to remove group membership

XMLWordPrintable

      Currently the user synchronization runs a select query in the cwd_membership to retrieve the ID to pass it to the delete statement afterwards for each user that needs to be removed.

      SELECT ID, parent_id, child_id, membership_type, group_type, parent_name, lower_parent_name, child_name, lower_child_name, directory_id FROM cwd_membership WHERE parent_id='83631' AND child_id='531047' AND membership_type='GROUP_USER' AND directory_id='10000'
      
      DELETE FROM cwd_membership WHERE ID='34779315'
      

      Problem is there is no index on the child/parent ids so the select query can take a long time for each user to be executed when we have a huge table.

      workaround

      Create a new index on cwd_membership

      CREATE INDEX idx_mem_type_dir_parent_child ON cwd_membership (parent_id, child_id, membership_type, directory_id);
      

              Unassigned Unassigned
              malmeida Marcus Silveira
              Votes:
              5 Vote for this issue
              Watchers:
              13 Start watching this issue

                Created:
                Updated: