You should look into oracle optimizing guide, I would start trying to analyze the table to rebuild the statistics
analyze table &table estimate statics;
If you still suffer from the problem, try building the query dynamically so you don't use like on all fields if they aren't needed (use Criteria for that). You can also fallback to native query and dont use bind variables, but in my experience they should be fast unless there is a problem. Also, check if your database is propertly patched to at least 10.1.5/10.2.4, there is lots of fixes reported in the release notes. If you don't manage to find a solution that way, try using a different tool that support bind variables and try your query into it to see if the problem persists (I recomend PL/SQL Developer from Allround Automations, they have a trial available and it can run on wine with the Instant Client if you are not on windows), if it doesn't maybe the JDCB driver is doing something weird, try making sure you using the ojdbc5 driver instead of ojdbc14). Hope that helps :)
|