Tuesday, April 10, 2012

Baseline Plan for a SQL Query


SELECT *
FROM TABLE( dbms_xplan.display_sql_plan_baseline( sql_handle=>'SQL_6b9356eea6ab68ab', format=>'all'));

sql_handle comes from dba_sqpl_base_lines.sql_handle

parameter format can have following 3 value

  1. basic: i do not know why somebody will use this value for format parameter. i can think of only one situation when you would use this value. Suppose you want to see plan for a query and your girl friend is shouting from the driveway and threatening you. At that time you may use this value for format parameter. See the plan and save in your brain and run. when you reach driveway, you beg your girl friend to drive your Shelby. while sitting in passenger seat, just do two things, say your are right to whatever your girl friend says and use remaining part of brain to analyze sql plan
  2. typical: This value is good enough
  3. all: Gives most information

No comments:

Post a Comment