Joined: Fri Mar 31, 2006 4:38 am Posts: 1
|
Hibernate version: 3
Name and version of the database you are using: Oracle 9
We have an application where users can log in and see some information about themselves. A part of the information is in a big table. The table is divided into many partitions according to "inserted" field. Each partition corespondes one month (BIGTABLEMMYY: BIGTABLE0106, BIGTABLE0206 and so on). At the time Hibernate makes a full scan of the table which is not necessary for the business logic and takes too much time. I would like to make Hibernate quering just the last few partitions to make it faster.
How can I achieve it?
The solution I suppose to have now is to use SQL instead of HQL and make the query like this:
select * from bigtable PARTITION (BIGTABLE0106) t union all select * from bigtable PARTITION (BIGTABLE0206)
Does anyone have any other solution?
Thanks.
|
|