Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The table below describes the information displayed for regular operation types.

Table 9-10 Operations

 

Column    Description

...

ColumnDescription
Image AddedClick to locate and highlight the operators in the Execution Plan tree that match the selected operation type.
Operation

...

TypeIndicates type of operator, such as, Clustered Index Scan, Index Seek, Nested Loop, and so on.
Major Operation

...

Type

Displays the major types of the operators. The operators in the Execution Plan tree are separated into the following major types:

  • Table (any access to table)
  • Index (any access to index)
  • Sort (any sort operation)
  • Join (any join operation)
  • Spooling
  • Other (all other operations)
Estimated

...

CostTotal estimated cost breakdown according to operation types.
Operations

...

Indicates the number of operators of the specified operation type.

...

ObjectsIndicates the number of referenced tables/indexes of the specified operation type.

About viewing general properties of a selected statement

The Properties item under the More tab displays general details of the selected statement. The table below describes the properties displayed for a selected statement.

Table 9-11 Selected statement properties

Column

...

Description
Statement

...

IDDisplays the name of the statement or batch that the SQL tab was launched with. Can also be the name of the statement opened manually.
Database

...

Indicates the database that was in use when the statement was run.
Parsing

...

UserIndicates the user that was in use when the statement was run.
Cabinet

...

Indicates the cabinet in which the statement was saved.

...

FolderIndicates the folder in which the statement was saved.
Estimate

...

CostIndicates the total estimate cost of the statement as calculated for the last access plan.
Most Recent Show

...

PlanIndicates the last time the statement or batch was explained.
Plan

...

Time

Indicates when the Access Plan was saved. An Access Plan is saved in two cases:

...

  1. there is no Access Plan for the statement and this is the first time it is saved;

...

  1. changes were made to the statement's Access Plan.

Observing a history of resource consumption

The History view tab displays Resource Consumption Over Time vs. Access Plan Changes, to determine how the changes affected the performance of the statements or batches.

...

  • Main area
  • Change history area

About the Main area

The Main area (upper area) displays Resource Consumption Over Time vs. Cost and Changes Over Time.

About viewing a history of resource consumption over time

The History view displays Resource Consumption Over Time vs. Cost and Access Plan Changes Over Time in a number of overtime graphs.

  • In

...

  • Sybase. Displays the Resource Consumption of the selected statement over a specified time period.

...

  • Cost. Displays the Estimated Cost of the selected statement over a specified time period.

...

  • Changes. Displays Access Plan Change indications for the statement vs. Average Duration over a specified time period.

...

  • Executions. Displays the number of executions of the selected statement over a specified time period.

About viewing execution plan text

The Text view displays the Execution Plan's text.

About the Change History area

The Change History area (lower area) displays all the Access Plan changes made over a specified time period.

About viewing Access Plan Changes

The Access Plan Changes view displays a list of all the Access Plans of the statement as detected by the Explain Statement process.

Table 9-12 Access Plan Changes table

Column    Description

...

ColumnDescription
Image AddedClick to switch to Plan view and display the selected Access Plan.

...

DateIndicates the date the specified Access Plan was detected by the Explain Statements process.
Estimate

...

CostIndicates the estimated cost of the specified Access Plan.
Table

...

ScansDisplays the number of table scans performed in the specified Access Plan.
Index

...

ScansDisplays the number of index scans performed in the specified Access Plan.

...

ParallelDisplays the number of parallel operations performed in the specified Access Plan.
Nested

...

LoopsDisplays the number of nested loops performed in the specified Access Plan.
Merge

...

JoinsDisplays the number of merge joins performed in the specified Access Plan.

...

SortsDisplays the number of sort operations performed in the specified Access Plan.

Breaking down a batch's access plan into statements

In many cases a statement is part of a long batch (such as a Stored Procedure or improvised batch). Sometimes you want to examine a particular statement, and sometimes you want to view the statement in the context of the entire batch.

The Statements view breaks down the Access Plan of the entire batch into statements and correlates the statements in the Access Plan with the statements that were captured by the Precise for Sybase Collector agent. The statement IDs of these statements that were captured are displayed in Precise. It is possible to view the Access Plan of a different statement by clicking its respective Plan icon.

Info

...

Only statements that were captured by the Precise for Sybase Collector agent can be chosen.

When you switch to this view in the context of a batch, all the batch's statements are listed. In this case, all the information displayed is related to the selected batch.

...

Table 9-13 Statement's View table

Column    Description

...

ColumnDescription
Image Added

Click to switch to Plan view, in-context with the selected statement.

...

Info

This icon is only enabled at batch level and in the statement that was captured by the Collector agent.

ID

...

Indicates the ID of the statement in the batch.
Collector

...

StatementDisplays the ID of the statement and batch as assigned by the Precise for Sybase Collector agent.
Physical

...

OperatorDescribes how a query or update was executed. The physical operator describes the physical implementation used to process a statement, for example: Batch level, Select, Update, Cond, and so on.

...

OperationsDisplays the number of operations in the specified statement.
Table

...

ScansDisplays the number of Table Scans performed in the specified statement.

Table 9-13 Statement's View table

Column    Description

...

Index ScansDisplays the number of Index Scans performed in the specified statement.
Joins

...

Displays the number of join operations performed in the specified statement.

...

SortsDisplays the number of sort operations performed in the specified statement.
Estimated

...

CostDisplays the estimated cost for the specified statement.

About the Actions tab

The Actions tab, on the Precise bar, lets you perform additional actions. You can perform the following actions:

  • Create a new statement
  • Open an existing statement
  • Edit an existing statement
  • Re-Explain an existing statement
  • Display the Sybase plan using Sybase SQL Advantage and Interactive SQL

Creating a new statement

You can create a new Statement and save it in the PMDB in a logical cabinet and folder hierarchy. You can also rewrite statements and view their Access Plans.

...

  1. On the Precise bar, click Actions>New.
  2. In the New Statement dialog box, choose the relevant properties for the new statement from the drop-down lists and enter a statement name, as follows:
    • Instance    Indicates Instance. Indicates the name of the instance that the statement belongs to.
    • Cabinet    Indicates Cabinet. Indicates the name of the cabinet that the statement is saved in (creates a cabinet if it does not already exist).
    • Folder    Indicates Folder. Indicates the name of the folder that the statement is saved in (creates a folder if it does not already exist).
    • Name    Indicates Name. Indicates the name of the statement (generated randomly).
    • Database    Indicates Database. Indicates the name of the database where the statement is running.
    • User    Indicates User. Indicates the statement's parsing user.
  3. Enter the SQL text for the statement in the text frame.
  4. Click OK.

The new statement is saved in the PMDB in a logical cabinet and folder hierarchy.

Opening an existing statement

You can view a statement that was saved in the PMDB. To open an existing statement

  1. On the Precise bar, click Actions>Open.
  2. In the Open Statement dialog box, choose the relevant properties for the statement you want to view from the Instance, Cabinet, Folder and Name drop-down lists, as follows:
    • Instance    Indicates Instance. Indicates the name of the instance that the statement belongs to.
    • Cabinet    Indicates Cabinet. Indicates the name of the cabinet that the statement is saved in (creates a cabinet if it does not already exist).
    • Folder    Indicates Folder. Indicates the name of the folder that the statement is saved in (creates a folder if it does not already exist).
    • Name    Indicates Name. Indicates the name of the statement (generated randomly).
    • Database    Indicates Database. Indicates the name of the database where the statement is running.
    • User    Indicates User. Indicates the statement's parsing user.
      The statement's text is displayed in the text frame.
  3. Click OK.

Editing an existing statement

You can edit a statement that was saved in the PMDB. The statement that was collected by the Collector agent is saved as a New Statement in a logical cabinet and folder hierarchy.

...

  1. On the Precise bar, click Actions>Edit.
  2. In the Edit Statement dialog box, define the statement you want to edit by choosing a relevant property from the drop-down lists, as follows:
    • Instance    Indicates Instance. Indicates the name of the instance that the statement belongs to.
    • Cabinet    Indicates Cabinet. Indicates the name of the cabinet that the statement is saved in (creates a cabinet if it does not already exist).
    • Folder    Indicates Folder. Indicates the name of the folder that the statement is saved in (creates a folder if it does not already exist).
    • Database    Indicates Database. Indicates the name of the database where the statement is running.
    • User    Indicates User. Indicates the statement's parsing user.
  3. Enter a New Statement name in the Name field.
  4. Edit the SQL text for the statement in the text frame.
  5. Click OK.

The edited statement is saved in a logical cabinet and folder hierarchy.

Re-Explaining an existing statement

You can Re-Explain an existing statement. If the new access plan is different from the most recent access plan, it is saved in the PMDB and displayed.

To re-explain an existing statement, click the Re-Explain tab

Display the Sybase plan using Sybase SQL Advantage and Interactive SQL

You can display the Sybase plan using Sybase SQL Advantage and Interactive SQL. To display the Sybase plan using Sybase SQL Advantage and Interactive SQL, click the Sybase Plan tab.

...

You can identify a performance problem by doing one or more of the following:

Anchor
Identifyingproblematicoperatorsinthelatestaccessplan
Identifyingproblematicoperatorsinthelatestaccessplan
Identifying problematic operators in the latest access plan

The first step in tuning a statement is to identify problematic operators. Problematic operators are operators whose estimated cost is high.

...

  1. Launch to the SQL tab with a statement in-context or open the statement you want to analyze in the SQL tab.
  2. Open the Statistics tab in Plan view
  3. Sort the grid by the Estimated Cost value (desc.)

...

Info

The lower Estimated Cost the better.

Following are examples of how to improve problematic operators:

  • If the operator is a Table Scan, try creating an index.
  • If the operator is of a Join type (such as Nested Loop or Merge), examine a different join method.
  • If the operator is a Sort operation, check if the sort is required by the application or can be removed. For example, remove distinct or change the union clause to union all.

See “About the Execution plan tree” on page 100.

Anchor
Locatingreferencedtablesthatposepotentialproblems
Locatingreferencedtablesthatposepotentialproblems
Locating referenced tables that pose potential problems

When it is not possible to access the statement, such as in third company products, the only way to improve the statement is by improving access to the data. This can be achieved by performing changes in the referenced objects by examining the operators that access the tables and identifying potential problematic operators.

...

  1. Launch to the SQL tab with a statement in-context or open the statement you want to analyze in the SQL tab.
  2. On the Plan tab, click Objects.
  3. Click the Locator icon (to locate and highlight all the operators in the execution plan that access the specified table).
  4. Examine the cost of these operators (to locate the problematic operators).
  5. Identify the objects that are referenced by the problematic operators and try to tune those objects.

See “About viewing which objects are referenced by the execution plan” on page 103.

Anchor
Examininghowaccesspathchangesaffectstatementperformance
Examininghowaccesspathchangesaffectstatementperformance
Examining how access path changes affect statement performance

Precise for Sybase allows you to track the Access Plan changes and compare them with the Resource Consumption of your statement to understand how the changes affected the statement's performance.

...

  1. Launch to the SQL tab with a statement in-context or open the statement you want to analyze in the SQL tab.
  2. On the History tab, on the View controls, click History.
  3. Analyze the statement's resource consumption over time vs. execution cost, access path changes, and number of executions over time. This can help you to observe whether the change in the statement performance occurred due to the change in the access path or not.
  4. In the Changes History table, you can view additional details on the change made. You can select the launch icon for a particular access path and launch to the Plan tab in-context to continue your analysis of the change.

Anchor
Locatingthemostresourceconsumingstatementsinabatch
Locatingthemostresourceconsumingstatementsinabatch
Locating the most resource-consuming statements in a batch

The main difference between examining a statement's Access Plan and a batch's Access Plan is in the number of operators in the Access Plan. Understanding an Access Plan with hundreds of operators is a difficult task. The Statements view can assist you with this task since it shows the Access Plan statements and their Estimated Cost. The ID of the statements sampled by the Precise for Sybase Collector agent are also displayed.

...