It\'s driving me crazy. Making hibernate simple select is so slow, comparing to running that query directly via Navicat. What is more intereting. Running this query with loc
Thank you all for help. After long time of struggling with that issue, finally kaliatech answer helped me to debug the problem.
First of all, I've made a terrible mistake in my quesion. I wrote that:
Running this query with local database is really fast, but using it remotely is really poor.
As it is not completly true. The query which I did in Hibernate looks like the one up:
select s.* from sales_unit s left join sales_unit_relation r on (s.sales_unit_id = r.sales_unit_child_id) where r.sales_unit_child_id is null
But the actual query which I did with SQL PLus or Navicat for example was:
select * from sales_unit s left join sales_unit_relation r on (s.sales_unit_id = r.sales_unit_child_id) where r.sales_unit_child_id is null
Please notice that first query select starts: select s.* ... and second one is select * .... And that was the reason of such poor performance. Now both queries are completed in no time. The question is, what's the difference: performance issue: difference between select s.* vs select *