Chatta subito con l'assistenza
Chat con il supporto

SQL Optimizer for SAP ASE 3.9 - User Guide

Introduction Tutorials Preferences Editor Functions SQL Information and Functions Performance Monitor SQL Inspector SQL Collector for Monitor Server SQL Scanner Index Advisor SQL Optimizer
SQL Optimizer Overview Optimization Engine Common Coding Errors in SQL Statements What Function Should l Use to Retrieve the Run Time? Unsatisfactory Performance Results SQL Optimizer Functions SQL Editor Optimized SQL Activity Log
SQL Worksheet SQL Formatter Database Explorer Code Finder Object Extractor SQL Repository Index Impact Analyzer Index Usage Analyzer Configuration Analyzer Migration Analyzer Abstract Plan Manager User-Defined Temp Tables SQL History Legal Information

Enter Original SQL Statement

SQL Optimizer > SQL Editor > Enter Original SQL Statement

The SQL statement that you want to optimize is referred to as the original SQL statement.

To optimize a SQL statement

  1. Click image\B_SQLOptimizer.gif.

  2. Enter the SQL statement by typing it in, opening an existing file, or pasting it. Parameters within the SQL statement can be prefixed with a "@" sign or without.

To help construct a SQL statement use the member lookup, argument lookup, auto correction, indent, outdent , comment, and uncomment functions.

For SQL statements that involve temporary tables, you need to create the temporary table first before optimizing the SQL statement using the User-Defined Temp Table window.

Only one SQL Optimizer window can be opened at any time. The system will prompt you to save the original SQL statement if you attempt to open another file.

You can perform the following functions from the SQL Optimizer window:

Note: The SQL Optimizer supports only a single SELECT, SELECT INTO, DELETE, UPDATE and INSERT SQL statement. To optimize SQL within Transact SQL, use the SQL Scanner module to identify potential problematic SQL statements (e.g. database objects such as Procedures.)

 

Related Topics

Retrieve Query plan

SQL Optimizer > SQL Editor > Retrieve Query plan

By examining the query plan, you can see exactly how the database executes your SQL statement, helping you judge whether the SQL statement is the most efficient or any changes to the table structure are needed such as adding a new index.

To view the query plan of the original SQL statement in the SQL Optimizer window

Click image\B_ShowPlan.gif.

If parameters exist in the original SQL statement, you are required to define the parameters and data types of the parameters before the query plan is retrieved. Or, alternatively use the SQL | Show Default Plan to retrieve the query plan without the need to enter parameter details. Show Default Plan allows you to quickly view the query plan without the need to enter the data type variables.

For more specific information about each step of the query plan, click any text in the step and the Plan Detail window displays.

 

Related Topics

Show Default Plan

SQL Optimizer > SQL Editor > Show Default Plan

When the original SQL statement has parameters, you need to determine the data type of the parameters when executing the Show Plan, Optimize, Run Result, Run for all Records, or Run for First Record functions.

If you would like to view the query plan without needing to enter all the data types and values for the parameters, use the SQL | Show Default Plan to retrieve the query plan. In this case, all the parameters are assumed to have a BINARY data type when executing the Show Plan function. This is useful when you want to quickly investigate the query plan of the original SQL statement.

 

Related Topic

Optimize Original SQL Statement

SQL Optimizer > SQL Editor > Optimize Original SQL Statement

If sending a SQL statement from the SQL Scanner, SQL Worksheet, Database Explorer, or SQL Formatter to the SQL Optimizer (Edit | Send to SQL Optimizer), these statements are automatically optimized.

To optimize a SQL statement

  1. In the SQL Optimizer window, enter the SQL statement in the SQL Editor pane of the SQL Optimizer.

  2. Click image\B_Optimize.gif.

The time it takes to optimize is dependent on the complexity of the original SQL statement and the quota values set in the Preferences window.

During optimization, the unique optimization engine uses multiple SQL syntax transformation rules to produce a list of semantically equivalent SQL statements. Selected optimization forces from the Preferences window are also applied to produce the list of optimized SQL statements.

To stop the optimization process

Click image\B_AbortOptimize.gif.

It may take a few seconds to terminate all processes.

Note:When setting the searching quota values that, the higher the quota, the longer it may take to optimize a complicated SQL statement.

 

Related Topic

Related Documents

The document was helpful.

Seleziona valutazione

I easily found the information I needed.

Seleziona valutazione