Description
The grouper_composites table has a composite_factor_idx which is an index on left_factor and right_factor. The API does the query:
select * from grouper_composites c
where c.left_Factor = :left or c.right_Factor = :right;
when adding a member to a group. During profiling of a loader program the method HibernateCompositeDAO.findAsFactor(GroupDTO) was using 14% of CPU. An Oracle explain plan showed a full table scan on grouper_composites. By adding an index on right_factor the CPU reduces to 8% and explain plan shows the indexes are being used.
NB: If there were a method to add a collection of subjects presumably the method could be called once, rather than each time a member is added.