I don't see a join clause in your query. Without a join clause, you will get a cartesian product, and the performance will degrade exponentially as the tables grow.
You need something like "Template.id = message.id" to avoid a cartesian product. You can see examples of what I'm talking about here: http://www.w3schools.com/sql/sql_join.asp View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4045491#4045491 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4045491 _______________________________________________ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user