In case that huge number of user are registered in Liferay database,
a processing time is very long when adding a user.
In our test,
when 20,000 user are registered,
a processing time is about 3-4 sec.
when 50,000 user are registered,
a processing time is about 6-7 sec.
I think it is because of containsTableMapping method in TableMapperImpl class.
In this method, getPrimaryKeys method is called and in getPrimaryKeys method, query which is defined by getRightPrimaryKeysSqlQuery is executed just like
"SELECT userId FROM Users_Roles WHERE roleId = ?"
And then acquired userId lists is checke by Arrays,binarySearch in containsTableMapping.
I think executed query should be
"SELECT userId FROM Users_Roles WHERE roleId = ? and userId = ?"
If so, containsTableMapping method won't call Arrays.binarySearch method.
And a processing time is quite shorter.