Data Grid - scrollable cursor

Hello,

when a query is run and the result is displayed in the Data Grid - how is this query actually executed? As a scrolling cursor or forward only? If it is not a scrolling cursor, does this mean the result data is cached somewhere in the client / on disk?

regards,

gerald

Hi Gerald,

If you run with F9, it's a scrollable cursor.

If you run with F5, it's forward only, stored in memory. We do not cache query results on disk.

-John

Thanks for your answer, John.

Does it make any difference when TOAD sees a /*+ gather_plan_statistics */ or alter session set statistics_level=all ?

The reason why i'm asking:

TOAD:

  • run query (F9) with /*+ gather_plan_statistics */ in TOAD, query returns no rows.
  • fetch sql_id in another (sysdba) connection using v$sqlarea
  • use sql_id in dbms_xplan.display_cursor with FORMAT=>'ALLSTATS LAST'
  • output contains A-Rows, E-Rows, etc

playing around with Oracles ODPI-C library:

doing exactly the same with an scrollable cursor and the xplan results is missing the A-Rows and extended statistics until i close the program (=releasing statement, closing connection, etc). after that, i see the full statistics. I dont even have to fetch the data.

How does TOAD do that? Is it releasing the statement right after fetching a couple of rows or no rows?

just curious - can’t make heads or tails of it.

thx,

gerald

Hi Gerald,

Toad doesn't do anything differently regardless of the optimizer hint. We just send the query to Oracle and Oracle gives us a result. We don't close the cursor until user closes the editor tab or runs another SQL in the same tab.

-John