Why does JBoss load each column separately?
ottoberg Mar 3, 2005 11:18 AMRecently, we are observing that most finder queries take exceedingly long to finish. Looking for the reason we have switched on cmp logging and found that relations are loaded column by column:
Executing SQL: SELECT id, salutation FROM PERSON WHERE (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) 2005-03-03 16:31:28,089 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.Person] Executing SQL: SELECT id, gender FROM PERSON WHERE (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) 2005-03-03 16:31:28,105 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.Person] Executing SQL: SELECT id, title FROM PERSON WHERE (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) 2005-03-03 16:31:28,121 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.Person] Executing SQL: SELECT id, firstname FROM PERSON WHERE (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) 2005-03-03 16:31:28,152 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.Person] Executing SQL: SELECT id, lastname FROM PERSON WHERE (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?)
Granted, all relations are loaded in one fell swoop, but column by column. Since we have no comparison data, that is we don't know if JBoss behaved differently before the performance degradation we cannot attribute our problems to this phenomenon. Maybe we have to look elsewhere.
Still I would like to know if this is JBoss' intended behaviour. If the answer is yes I would like to know why. If the answer is no, maybe someone could give me a pointer as to where I can control this behaviour.
Thanks for any help,
Olaf