Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » SQL Anywhere Server - SQL Usage » Query Optimization and Execution » Reading execution plans » Text plans

Short text plan Next Page

Long text plan

The long plan provides a little more information than the short plan, and provides information in a way that is easy to print and view without scrolling.

In the following example, the first line of the long plan is Plan[ Total Cost Estimate: 1.040539E-5 ] The word Plan indicates the start of a query block. The Total Cost Estimate is the optimizer estimated time, in milliseconds, for the execution of the plan. The plan indicates that the results are sorted, and that a Merge Join is used. On the same line as the join operator, there is either the word TRUE or the residual search condition and its selectivity estimate (which is evaluated for all the rows produced by the join operator). The HashFilter indicates that a hash filter is being built on the right-hand side of the Merge Join. The IndexScan lines indicate that the Customers and SalesOrders tables are accessed via indexes CustomersKey and FK_CustomerId_ID respectively.

SELECT GivenName, Surname, OrderDate, Region, Country
FROM Customers JOIN SalesOrders ON ( SalesOrders.CustomerID = Customers.ID )
WHERE CustomerID < 100 and ( Region like 'Eastern' or Country like 'Canada' )
ORDER BY OrderDate;
( Plan [ Total Cost Estimate: 1.040539E-5 ] 
  ( WorkTable
    ( Sort
      ( MergeJoin [ ( ((Customers.Country LIKE 'Canada' : 100% Computed) AND (Customers.Country = 'Canada' : 7.936508209% Statistics)) OR ((SalesOrders.Region LIKE 'Eastern' : 100% Computed) AND (SalesOrders.Region = 'Eastern' : 5% Guess)) ) : 100% Guess ] 
        ( 1 HashFilter 
          ( IndexScan Customers CustomersKey )
        ( IndexScan SalesOrders FK_CustomerID_ID[ hash( SalesOrders.CustomerID ) in hashmap( Customers.ID ) : 100% Guess ] )

For more information about the abbreviations used in a plan, see Abbreviations used in the plan.