Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Oracle IN clause with collection of elements

User_19BPUJan 26 2012 — edited Mar 1 2012
Hi,

I am using a IN clause in Oracle DB to pass a collection of custId to retrieve the customer details. If it was 10 or 50 custId's as a collection in IN clause it
works fine. But if the collection grows bigger to 500 or 1000 then it is pretty slow to load the JSP page with the customer details.

Here is the query:-

select CustName, CustAge, CustCity, CustPin from CUSTOMER where custId IN (....)

The list of custId that is passed through Hibernate query.setParameterList()

How to optimize this query to make sure it displays the customer details faster even if the collection of elements which we pass is huge?
Please let me know your opinion.

Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 29 2012
Added on Jan 26 2012
13 comments
3,453 views