-
Bug
-
Resolution: Fixed
-
High
-
2.8
-
None
-
MySQL5
-
4
-
While debugging an outage at wikis.sun.com I noticed that the code in HibernateUserManager#addMembership generates some extremely inefficient queries that were giving our db and network hard time:
membership = dGroup.getLocalMembers(); if (membership == null) { membership = new HashSet(); dGroup.setLocalMembers(membership); } membership.add(user);
The last line of the code translates to:
DEBUG 2008-07-02 11:35:43,801 [service-j2ee-3] BatcherImpl:log - select localmembe0_.groupid as groupid__, localmembe0_.userid as userid__, defaulthib1_.id as id0_, defaulthib1_.name as name0_, defaulthib1_.password as password0_, defaulthib1_.email as email0_, defaulthib1_.created as created0_, defaulthib1_.fullname as fullname0_ from local_members localmembe0_ inner join users defaulthib1_ on localmembe0_.userid=defaulthib1_.id where localmembe0_.groupid=? DEBUG 2008-07-02 11:35:43,806 [service-j2ee-3] BatcherImpl:log - insert into local_members (groupid, userid) values (?, ?)
Which means retrieve*all* members of a given group and then insert the user to the db.
If you run this query on our db with 25k users in a group, you run into some really big problems. By that I mean that the query can easily run several minutes and affect the overall db performance.
The code should be rewritten so that the uniqueness constraint is checked by a SELECT and if no dupe is found the INSERT can follow, otherwise this code will never scale.
- is related to
-
CONFSERVER-14989 Possible net.sf.hibernate.impl.SessionImpl Memory Leaks
-
- Closed
-
-
CONFSERVER-13754 HibernateGroupManager.hasExternalMembership() is slow for group with thousands of users
-
- Closed
-
-
CONFSERVER-8675 Support for thousands of groups needs improvement
-
- Closed
-
- relates to
-
CONFSERVER-10030 db2: queries that use 'lower' do not use index because of case sensitivity
- Closed
- was cloned as
-
CONFSERVER-18347 Adding LDAP User to a large internal group (e.g. confluence-users) is slow
-
- Closed
-
[CONFSERVER-12319] Adding users to a large group is slow with default (Hibernate) user management
Workflow | Original: JAC Bug Workflow v3 [ 2896607 ] | New: CONFSERVER Bug Workflow v4 [ 2989506 ] |
Workflow | Original: JAC Bug Workflow v2 [ 2787961 ] | New: JAC Bug Workflow v3 [ 2896607 ] |
Status | Original: Resolved [ 5 ] | New: Closed [ 6 ] |
Workflow | Original: JAC Bug Workflow [ 2719765 ] | New: JAC Bug Workflow v2 [ 2787961 ] |
Workflow | Original: Confluence Workflow - Public Facing - Restricted v5 - TEMP [ 2388882 ] | New: JAC Bug Workflow [ 2719765 ] |
Workflow | Original: Confluence Workflow - Public Facing - Restricted v5 [ 2265926 ] | New: Confluence Workflow - Public Facing - Restricted v5 - TEMP [ 2388882 ] |
Workflow | Original: Confluence Workflow - Public Facing - Restricted v5.1 - TEMP [ 2209455 ] | New: Confluence Workflow - Public Facing - Restricted v5 [ 2265926 ] |
Workflow | Original: Confluence Workflow - Public Facing - Restricted v5 - TEMP [ 2194394 ] | New: Confluence Workflow - Public Facing - Restricted v5.1 - TEMP [ 2209455 ] |
Workflow | Original: Confluence Workflow - Public Facing - Restricted v5 [ 1927660 ] | New: Confluence Workflow - Public Facing - Restricted v5 - TEMP [ 2194394 ] |
Workflow | Original: Confluence Workflow - Public Facing - Restricted v3 [ 1737363 ] | New: Confluence Workflow - Public Facing - Restricted v5 [ 1927660 ] |
Workflow | Original: CONF Bug Subtask WF (TEMP) [ 1697359 ] | New: Confluence Workflow - Public Facing - Restricted v3 [ 1737363 ] |