I have a table and from that I am fetching records somewhere around 250,000 records and this is taking some 25 mins, is there a way to decrease the fetch time. I am using some code like below :-
query.setParameterList("studentId", StudentIdList);
Is there a way to optimize it?
If it takes less than 10 minutes from the SQL command line and more than 25 minutes from Hibernate then you may want to look into the information on batching. In particular you might benefit from a stateless session (especially if you’re not doing much work). If you’re really not doing much work you may be able to use a DML statement (also in that URL).