Re: SQL Developer - Selects



markus.schreyer@xxxxxxxxx, 31.10.2007 10:20:
When I open a datatable (tab data), SQLD does a coresponding select on
the table. Looking at enterprise manager i see that the select
consists out of ORA_ROWSCN and all the columns from the table. In a
table with million records i get an instant result cause only 55 rows
in my case are fetched. When i take the same select and execute it,
it would take much longer cause i get the whole table. How is it
possible to limit the number of records in the result with such a
select?

SQL Developer uses JDBC. JDBC offers to set the maximum number of rows returned by the query, and I assume that SQL Developer is using that feature - especially as you cannot see any limits when you trace the statement.

I did a quick test with a different (Java/JDBC based) query tool, where I know it uses setMaxRows() and the behavior there is the same as with SQL Developer. A select * from big_table (5 Million rows) executes nearly immediately when max rows is set to 50.

My assumption is that the JDBC driver only sends the defined limit to the server (along with the query of course), and the server is able to take this into account when returning the result. The limit does not happen on the client side as far as I know.

Thomas
.



Relevant Pages

  • Re: why excute query through JDBC much slow than query analyzer?
    ... why excute query through JDBC much slow than query analyzer? ... The SendStringParametersAsUnicode is a connection string attribute that is ... If you capture the Execution Plan in a SQL Profiler trace while executing ...
    (microsoft.public.sqlserver.jdbcdriver)
  • Re: Setting Query Timeout through JDBC (CA Driver problem?)
    ... I suggest to you not using commands like ""set lockmode ..." ... inside jdbc because they are not intended for being used like that nor ... About query timeout we have not used it, but I do not remember any ...
    (comp.databases.ingres)
  • Re: database toolbox problem
    ... I have found a workaround for this problem. ... This bug is already listed in the Matlab bug reports and ... query = 'ALTER TABLE test ADD test_col VARCHARNOT NULL'; ... "The JDBC spec states that you must either use ...
    (comp.soft-sys.matlab)
  • Re: JDBC / ODBC problem
    ... surprised if you find bugs in databases, JDBC or ODBC drivers. ... Do the query differently. ...
    (comp.lang.java.programmer)
  • Re: number of rows in a resultset
    ... > JDBC allows the driver to read the results in chunks. ... > If your ResultSet isn't scrollable, then you have to walk through it: ... Also, maybe the first query could be an SQL "count", and the second query ... and as I am no SQL expert I have no idea if it would provide any ...
    (comp.lang.java.programmer)