Foxhound is the better* Database Monitor for SQL Anywhere.
*better: More thorough, more relevant, more effective.
...more Alerts, more All Clears, more details, more control in your hands.


[Home] [Table of Contents] [Previous Section] [Next Section]

Breck Carter
Last modified: February 12, 1998
mail to: bcarter@bcarter.com


Tip 77: Sybase SQL Anywhere
Performance Tips & Techniques


3 - Learn To Read The Plan

The order in which different tables are accessed as well as the search strategies used for individual tables provide important clues as to why a query runs slowly or quickly. Figure 3A shows how the ISQL Statistics window displays this information on a line labeled "PLAN>". Each table is named in the order it is accessed rather than the order it appears in the query and the strategies appear in brackets after each table name.

Figure 3A - ISQL PLAN Display For 2 Tables

The line "PLAN> parent1 (parent1), child1 (parent1_child1)" means "the parent1 table is accessed first using its primary key index, and then child1 is accessed using the foreign key index with the role name parent1_child1." Figure 3B explains what the strategy messages mean, and indicates whether they are generally good or bad as far as performance is concerned.

Figure 3B - ISQL PLAN Messages Explained

table-name (seq) - sequential table scan (bad)

table-name (table-name) - primary key index used (good)

table-name (role-name) - foreign key index used (good)

table-name (index-name) - index used (good)

TEMPORARY TABLE table-name - temporary table and index will be used (bad)

table-name (table-name UNIQUE (column-name)) - unique constraint used (good)

table-name (seq): table-name (seq) - colon ":" for nested or UNION'ed queries


[Home] [Table of Contents] [Previous Section] [Next Section]