Bear Bibeault wrote:There are no "best" patterns. There are just applicable ones.
Martin Vajsar wrote:Unique constraint on CE(imp_date, cid) doesn't prevent the foreign key to be created.
Bill Gorder wrote:Why is your pool size set to 1? I hope you are not using hibernates pooling algorithm. This is not meant for production systems. See the documentation here:
http://docs.jboss.org/hibernate/orm/3.3/reference/en/html/session-configuration.html#configuration-hibernatejdbc
I would also make sure that the columns you are querying are on are properly indexed. I would run the execution plan and make sure you don't have full table scans happening. Probably speak to a DBA if you have one available.