Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Clearing the caches to measure performance is possible but very unwieldy.</p> <p>A very good measure for tracking achieved performance of tuning efforts is counting the number of read blocks during query execution. One of the easiest way to do this is using sqlplus with autotrace, like so:</p> <pre><code>set autotrace traceonly &lt;your query&gt; </code></pre> <p>outputs</p> <pre><code>... Statistics ---------------------------------------------------------- 0 recursive calls 0 db block gets 1 consistent gets 0 physical reads 0 redo size 363 bytes sent via SQL*Net to client 364 bytes received via SQL*Net from client 4 SQL*Net roundtrips to/from client 0 sorts (memory) 0 sorts (disk) 1 rows processed </code></pre> <p>The number of blocks read, be it from cache or from disk, is <code>consistent gets</code>.</p> <p>Another way is running the query with increased statistics i.e. with the hint <code>gather_plan_statistics</code> and then looking at the query plan from the cursor cache:</p> <pre><code>auto autotrace off set serveroutput off &lt;your query with hint gather_plan_statistics&gt; select * from table(dbms_xplan.display_cursor(null,null,'typical allstats')); </code></pre> <p>The number of blocks read is output in column <code>buffers</code>.</p> <pre><code>--------------------------------------------------------------------------------------------------------------------- | Id | Operation | Name | Starts | E-Rows | Cost (%CPU)| E-Time | A-Rows | A-Time | Buffers | --------------------------------------------------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 3 | | 1 (100)| | 3 |00:00:00.01 | 3 | | 1 | SORT AGGREGATE | | 3 | 1 | | | 3 |00:00:00.01 | 3 | | 2 | INDEX FULL SCAN| ABCDEF | 3 | 176 | 1 (0)| 00:00:01 | 528 |00:00:00.01 | 3 | --------------------------------------------------------------------------------------------------------------------- </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload