[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Performance problem with LEFT JOIN

toni do-not-reply at jboss.com
Fri May 11 10:05:52 EDT 2007


Hi,

I have a LEFT JOIN, which looks like this:


  | 
  | entityManager.createQuery("SELECT t FROM Template t LEFT JOIN t.messages c WHERE t.client.hostname=:ch GROUP BY t.id, t.subject, t.text, t.client ORDER BY count(c)").setParameter("ch", client.getHostname()).getResultList();
  | 

The problem is that the larger the table grow the poorer the performance is. After a while it takes about 3-4 seconds to execute.

Any ideas how I could optimize this?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4045006#4045006

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4045006



More information about the jboss-user mailing list