Versions Compared

Key

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

...

The table below shows from which tabs and entities it is possible to launch to the SQL tab, in context.

Table 9- 1 Launching in context

TabEntities
CurrentSession, Statement, Batch
ActivityStatement, Batch
SQLStatement entered manually by the user through a New action.
Info

If the SQL tab is opened with no statement in context, an error message is displayed requesting you open a statement.

...

The table below describes the available operation options.

Table 9- 2 Operation options

OperatorDescription
SortThe Sort operator presents the sorting of the rows returned from the previously executed operation (appears just below this operator) in a specific order, optionally eliminating duplicate entries. Sorting is required when no index that satisfies the requested ordering exists, or when an Index Scan is more expensive than sorting. It is usually used as the final step to retrieve the fetched data or a prior step for the Join or Stream Aggregate (Group By) operators. In some cases, the Sort operation requires more than the available memory, in which case a temporary table is used. This involves Disk I/O, which has an impact on performance. Sorting a large number of rows makes heavy use of the CPU, which can also affect overall server performance. The amount of memory needed for sorting can be estimated by multiplying the number of rows by the average row size. Therefore, minimizing the row size by selecting only the necessary fields will decrease the memory required for the Sort operation.
Nested JoinsNested Joins (also called Nested Loops) use the Nested algorithm to join two tables. The Nested algorithm works as follows: For each row in the outer table (the first table, appearing directly below the Nested Loop operator in the Explain tree), Sybase executes the Access Plan for the inner table (the second one). A large number of iterations may indicate a problem in choosing the Access Plan due to out-of-date statistics.
Merge JoinsA Merge Join algorithm is used to join two tables by merging them. Merge Join algorithms read both tables only once; therefore it is required that the input be sorted according to the Join predicates. Merge Joins are available in Precise for Sybase from version 12.0 and above. This option is grayed-out by default. To enable it on session level, execute the set sort_merge on command. See the Sybase Help for more details on how to enable Merge Joins on server level.

About the operators that are available in the plan tree

The table below describes the operators that are available in the Plan tree.

Table 9- 3 Operation options

OperatorDescription
StepThis operator indicates the start of the specified step Subtree.
Table ScanThis operator indicates that a table scan was performed on the specified table to receive the required data. The More column displayed in the ToolTip and in the Statistics tab specify the scan direction (forward/backward), the I/O size and the buffer replacement strategy. When there is no useful index, the optimizer performs a table scan to receive the required data.
Index ScanThis operator indicates that an index scan was performed on the specified index to receive the required data. The More column displayed in the ToolTip and in the Statistics tab specify the scan direction (forward/backward), the I/O size and the buffer replacement strategy.
Index SeekThis operator indicates that an index seek was performed on the specified index to receive the required data. The More column displayed in the ToolTip and in the Statistics tab specify the scan direction (forward/backward), the I/O size and the buffer replacement strategy.
Clustered Index ScanThis operator indicates that a clustered index scan was performed on the specified index to receive the required data. The More column displayed in the ToolTip and in the Statistics tab specify the scan direction (forward or backward), the I/O size and the buffer replacement strategy.
Clustered Index SeekThis operator indicates that a clustered index seek was performed on the specified index to receive the required data. The More column displayed in the ToolTip and in the Statistics tab specify the scan direction (forward or backward), the I/O size and the buffer.
Table LookupThis operator indicates that in addition to an access to the index pages, there is an access to the data pages of the table to receive the required data which is not included in the index itself. The More column displayed in the ToolTip and in the Statistics tab specify the I/O size and the buffer replacement strategy.
Nested LoopsThis operator indicates that the join between the two result sets under this operator is of type Nested Loops. The first operator under the Nested Loops operator is the outer table in the join and the second operator under the Nested Loops operator is the inner table in the join.
Merge JoinThis operator indicates that the join between the two result sets under this operator is of type Merge Join.
SortThis operator indicates that a sort operation was performed on the rows returned from the previously executed operation (appears just below this operator) in a specific order, optionally eliminating duplicate entries.
AggregateThis operator indicates that an Aggregate operation was performed on the rows returned from the previously executed operation (appears just below this operator). This operator appears in steps, which perform an evaluation of grouped or ungrouped aggregate functions such as SUM, AVERAGE and COUNT.
SubqueryThis operator indicates that a subquery was executed. The Subquery tree will appear under this operator. The More column displayed in the ToolTip and in the Statistics tab specify the nesting level of the subquery, the predicate type (IN, ANY, EXISTS, or EXPRESSION), and the type of query (correlated/ non-correlated).
SpoolingThis operator indicates that a temporary worktable was created to hold intermediate results. Temporary worktables are created in cases when the statement cannot be executed in one step. For example, if the statement contains an Order By clause and the optimizer cannot use an index to order the resulting rows, it creates a worktable to sort the resulting rows before returning them. The More column displayed in the ToolTip and in the Statistics tab specify why the temporary worktable was created (Order By, Distinct, Reformatting, and so on).
JoinThis operator indicates that a join operation was performed between a subquery output and another result set.
Parallelism MergeThis operator indicates that a parallelism merge was done to the result sets returned by all the worker processes involved in the parallel execution. The More column displayed in the ToolTip and in the Statistics tab specify the way in which the results of parallel scans were merged.
Log ScanThis operator indicates that a log scan operation was performed.

About the costs that are available in the plan tree

...

The table below shows the I/O Cost information operators available in the Plan tree.

Table 9- 4 I/O cost information operators

CounterDescription
Estimated CostLogical Reads * 2 milliseconds (which is the assumption of how long a logical read takes) + Physical Reads * 18 milliseconds (which is the assumption of how long a physical read takes).
Estimated Subtree CostTotal estimated cost of all the operator's Subtree operators.
Logical ReadsNumber of logical reads performed on the specified table. The number of logical reads estimated by the optimizer is based on the access method and the size of cache. In this case, the optimizer is estimating how many pages are likely to be in cache.
Physical ReadsPhysical reads are estimated based on the number of logical reads and the cache size. The optimizer is estimating how many pages will not be available in cache and will need to be read from disk.
Scan Count

A "scan" can represent any of these access methods:

  • A table scan.
  • Access using a clustered index. Each time the query starts at the root page of the index and follows pointers to the data pages, it is counted as a scan.
  • Access using a non-clustered index. Each time the query starts at the root page of the index and follows pointers to the leaf level of the index (for a covered query) or to the data pages, it is counted.
  • If queries run in parallel, each worker process access to the table is counted as a scan.
Estimated RowsNumber of rows from the current table that is estimated to satisfy the join.

About viewing a statement's text

...

The table below describes the information displayed in the tables used in the plan.

Table 9- 5 Tables used in the plan

ColumnDescription
Image Modified
Click to launch the Objects tab and focus on the specified table.
Image Modified
Click to locate and highlight all the operators in the Execution Plan that access the specified table.
UsedIndicates whether the specified table is used in the selected operator in the Execution Plan tree.
TableDisplays the full table name ([Database Name].[Owner].[Table Name]).
CostTotal cost of the operators that accessed the specified table.
Cost (%)Total cost in percentage of the operator that accessed the specified table.
RowsNumber of rows in the specified table.
Pages AllocatedThe number of pages allocated in the disk for the table records. The value might be incorrect due to out-of-date space usage information. If you suspect the value to be incorrect, use the sp_flushstats command to flush current space usage information from memory or run the update statistics command to recalculate the space usage fields.
Pages UsedThe number of pages used in the disk for the table records. The value might be incorrect due to out-of-date space usage information. If you suspect the value to be incorrect, use the sp_flushstats command to flush current space usage information from memory or run the update statistics command to recalculate the space usage fields.

About indexes of table

Displays a list of all the indexes of the selected table displayed in Tables Used in the Plan. The table below describes the information displayed in indexes of table.

Table 9- 6 Indexes of table

ColumnDescription
Image Modified
Click to launch the Objects tab and focus on the specified index.
Image Modified
Click to locate and highlight all the operators in the Execution Plan that access the specified index.
UsedIndicates whether the specified index is used in the selected operator in the Execution Plan tree.
IndexDisplays the index name.
Pages AllocatedThe number of pages allocated in the disk for the index records. The value may be incorrect due to out-of-date space usage information. If you suspect the value to be incorrect, use the sp_flushstats command to flush current space usage information from memory or run the update statistics command to recalculate the space usage fields.
Pages UsedThe number of pages used in the disk for the index records. The value may be incorrect due to out-of-date space usage information. If you suspect the value to be incorrect, use the sp_flushstats command to flush current space usage information from memory or run the update statistics command to recalculate the space usage fields.
CostTotal cost of the operators that accessed the specified index.
Cost (%)Total cost in percentage of the operators that accessed the specified index.
Index DepthNumber of levels in the index.
UniqueIndicates whether the index is unique.
ClusteredIndicates whether the index is clustered.

About Columns of Table

Displays a list of all columns in the selected table displayed in Tables Used in Plan. When an index is selected in Indexes of Table, the first column constitutes the index column sorted by the position of the column in the index, and marked with an Ascending or Descending icon.

The table below describes the information displayed in the columns of the table.

Table 9- 7 Columns of table

ColumnDescription

Image Modified

Image Modified

Indicates whether the column is part of the selected index and whether it is sorted in ascending or descending order.
ColumnDisplays the column name.
Key NumberDisplays the key number of the column in the index.
TypeDisplays the physical storage type of the column.

Displaying statistical information on operators in the execution plan tree

...

The table below shows the statistical information displayed for Operator ID and Type.

Table 9- 8 About viewing statistics on Operator ID and Type

ColumnDescription
Image Modified
Click to locate and highlight the operator in the Execution Plan tree that matches the selected operator in the grid.
Operator ID and TypeDisplays the operator ID and type.
Logical ReadsNumber of logical reads performed on the specified table. The number of logical reads estimated by the optimizer is based on the access method and the size of cache. In this case, the optimizer is estimating how many pages are likely to be in cache.
Physical ReadsPhysical reads are estimated based on the number of logical reads and the cache size. The optimizer is estimating how many pages will not be available in cache and will need to be read from disk.
Subtree CostDisplays the total estimated cost of all the current operation's sons.
Estimated CostDisplays the estimated cost of the current operation. A high cost value may indicate a problem in the current implementation of the operation. Estimated cost is calculated as followed: Logical Reads * 2 milliseconds (which is the assumption of how long a logical read takes) + Physical Reads * 18 milliseconds (which is the assumption of how long a physical read takes).
Estimated Cost (%)Displays the estimated cost (in percentage) of the current operator.
Estimated RowsNumber of rows from the current table that is estimated to satisfy the join.
Scan Count

A "scan" can represent any of these access methods:

  • A table scan.
  • Access using a clustered index. Each time the query starts at the root page of the index and follows pointers to the data pages, it is counted as a scan.
  • Access using a non-clustered index. Each time the query starts at the root page of the index and follows pointers to the leaf level of the index (for a covered query) or to the data pages, it is counted.
  • If queries run in parallel, each worker process access to the table is counted as a scan.
MoreDisplays additional information according to the specified operation. For example, in a table scan operation, the scan type (forward/backward), I/O size and buffer replacement strategy will be displayed.
ParallelIndicates whether the operator is running in parallel.

About viewing statistical information on operation types

...

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

Table 9- 9 Major operations

ColumnDescription
Image Modified
Click to locate and highlight the operators in the Execution Plan tree that match the selected major operation type.
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 Read access to table)
  • Index (any Read access to index)
  • Sort (any sort operation)
  • Join (any join operation)
  • Spooling
  • Other (all other operations)
Estimated CostDisplays the total estimated cost breakdown according to major operation types.
OperationsIndicates the number of operators of a specific major operation type.
ObjectsIndicates the number of referenced tables/indexes of the specified operation type. This column is only relevant for table and index operation types.

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

Table 9- 10 Operations

ColumnDescription
Image Modified
Click 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.
OperationsIndicates 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

ColumnDescription
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.
DatabaseIndicates the database that was in use when the statement was run.
Parsing UserIndicates the user that was in use when the statement was run.
CabinetIndicates 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;
  2. changes were made to the statement's Access Plan.

Observing a history of resource consumption

...

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

ColumnDescription
Image Modified
Click 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

...

The table below describes the information displayed in the Statement's View table.

Table 9- 13 Statement's View table

ColumnDescription
Image Modified

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.

IDIndicates 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.
Index ScansDisplays the number of Index Scans performed in the specified statement.
JoinsDisplays 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:

...

  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 Statement tab, observe the access plan statements and their estimated cost.
  3. Determine which of the statements has the highest estimated cost and focus your analysis on that statement.

 

...

  1. .

...

 

 

 

 

 

 

...