Versions Compared

Key

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

...

Table 2 Operation options

OperatorDescription
Sort

The 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

 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 Joins

A 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

...

OperatorDescription
StepThis operator indicates the start of the specified step Subtree.
Table Scan

This 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 Scan

This 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 Seek

This 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 Scan

This 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 Seek

This 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 Lookup

This 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 Loops

This 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.

...