Does the Oracle JDBC driver Make Any Changes to the SQL Syntax when It Is Issued with a Statement.setMaxRow Value?
(Doc ID 2109696.1)
Last updated on JUNE 23, 2017
Applies to:JDBC - Version 22.214.171.124.0 and later
Information in this document applies to any platform.
An application is deployed on an application server. The application is not performing well and as part of the review of database AWRs , 2 quite expensive SQL statements are seen which are frequently called from the application. Presumably this application call should be fast because it is using JDBC stmt.setMaxRows(5000) to limit first 5000 rows (number is configurable and the 5000 is the application default value) .
The SQL statements are select statements with bind variables and ORDER BY clauses.
Around usage of stmt.setMaxRows(5000) where SQL statement does full table scan and sorting (has ORDER BY ), is it correct to understand that the JDBC will not start limiting rowset untill after all database work will be completed and scanning and sorting big tables would still be very expensive operation?
Does the Oracle JDBC driver make any changes to the SQL syntax when it is issued with a Statement.setMaxRow value? In other words, is there any attempt to pass a SQL hint or other mechanisms to optimize the SQL execution plan in view of the maximum number of rows?
To view full details, sign in with your My Oracle Support account.
Don't have a My Oracle Support account? Click to get started!
In this Document