I am kind of new to hibernate. For last few days i am observing time taken to execute the hibernate query is little on the higher side.
The time taken here is only w.r.t executing the SQL query that is translated from the hibernate query.
When i take the equivalent SQL query from the logs and execute it on the oracle prompt it takes 4 ms, but i hibernate take 16 secs for the same query.
I do agree there ll be difference in performance compared this way, but performance here is like chalk and cheese.
The single SQL query formed here is something like this
select * from (select column1, column2, column3....., column 29 from A LEFT JOIN B on a.id=b.id LEFT JOIN C on a.id=c.id where <some criteria> order by column1) where rownum < 1001 ;
A contains 2.9 million rows
B contains 3 rows
C contains 4 million rows
All the id columns have indexed enabled.
The same query executed through JDBC takes only 2 secs.
Am i missing something here
Thanks in advance.