-
Bug
-
Resolution: Unresolved
-
Medium
-
None
-
8.20.11, 9.1.0
-
8.2
-
10
-
Severity 2 - Major
-
5
-
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);