SELECT * FROM ( select * from tableA where ColumnA = 'randomText' ORDER BY columnL ASC ) WHERE ROWNUM <= 25
When executing this query, due to some optimization by Oracle, the query takes about 14 minutes. If I delete the where clause, the query will execute in seconds. most columns of the table have indexes on them, including those mentioned above. I do not have much flexibility in the structure of the request, since I use sleep mode.
This query also returns results with the correct result:
SELECT * FROM ( select * from tableA, dual where ColumnA = 'randomText' ORDER BY columnL ASC ) WHERE ROWNUM <= 25
is there something i can do using hibernate?
UPDATE: I am using EntityManager.createQuery () and I am using setMaxResults (25) and setFirstResult (). the request above looks like the request for hibernation when watching logs
source share