AUTOTRUE analyzes the execution plan of SQL

*AutoTRACE is a very simple and convenient tool to analyze the execution plan and execution efficiency of SQL
*/

AUTOTRACE is a SQL*Plus feature that automatically traces the generation of an execution plan for a SQL statement and provides statistics about the processing of the statement.

SQL*Plus AUTOTRACE can be used instead of SQL Trace, the advantage of AUTOTRACE is that you don't have to format the trace file, and it will automatically display the execution plan for the SQL statement. However, AUTOTRACE parses and executes statements; EXPLAIN PLAN parses statements only.

Using AUTOTRACE does not produce trace files.

     AutoTrace of SQLPLUS is a very simple and convenient tool for analyzing the execution plan and execution efficiency of SQL, and in most cases, it is also a very useful tool. Using the SQL execution plan and execution status provided by the AutoTrace tool can provide the basis for optimization when we optimize SQL, as well as the obvious comparison effect of the optimization effect.

用法: SET AUTOT[RACE] {OFF | ON | TRACE[ONLY]} [EXP[LAIN]] [STAT[ISTICS]]

illustrate:

     One of the first three parameters {OFF | ON | TRACE[ONLY]} must be selected, and only one can be selected; the last two parameters [EXP[LAIN]] [STAT[ISTICS]] are optional, or neither The meaning of selecting TRACE[ONLY] is to only display explain and statistic, but not the SQL result set.

     1. SET AUTOTRACE OFF;    Display: Only the recordset is displayed, which is the default window effect of SQL PLUS

<! - StartFragment ->

    2.SET AUTOTRACE ON;                                                display: record set+explain+statistics

   3.SET AUTOTRACE ON EXPLAIN;                                 display: record set+explain

    4. SET AUTOTRACE ON STATISTICS;                          display: record set + statistics

    5.SET AUTOTRACE ON TRACEONLY;                         display: expain+statistics (do not display data)       

    6.SET AUTOTRACE ON TRACEONLY STATISTICS;   显示: statistics

    7.SET AUTOTRACE ON TRACEONLY EXPLAIN;         显示:  expain

  =============================================================================

Interpretation of the results
physical reads Physical read - the number of data blocks read from the hard disk during the execution of SQL
redo size Redo size - the size of the redo log generated during the execution of SQL
bytes set via sql*net to client
bytes received via sql*net from client bytes received via sql*net from client
sorts(memory) sorts that occur in memory
sorts(disk) cannot occur in memory The number of records that require a hard disk to assist in the sorting of
rows processed results 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327039541&siteId=291194637