maybe anybody can help me out with a quite strange behaviour using hibernate and oracle. It is the first time that i use hibernate and oracle, so it might be an easy step for you :).
But lets get into detail. A simple count(*) results in:
select * from ( select count(*) as col_0_0_ from TABLE tbl ) where rownum <= ?
That would not be a big deal, but if i have a selection with a limited amount of rows to be returned, it looks like that:
select * from ( select SOME_FIELDS from TABLE tbl order by tbl.ID desc ) where rownum <= 20
And that is not very fast. If i do it by my own like
select * from from TABLE tbl where rownum <= 20 order by tbl.ID desc
it is as fast as expected. Is there anything a can do against? Maybe my entity needs some more tags?
Thank You!