You can select a SQL statement from SQL Editor and use the context menu to visually display the execution plan of the statement. This feature allows developers or database administrators to optimize the database and SQL code. SQL developers or database administrators can tell from the query plan when to, for example, create table indexes, reorganize data tables, or change the way a query is written. This feature can be useful during troubleshooting and fine-tuning performance.
To obtain an execution plan for a particular statement:
Before you can get a query plan from within a SQL file, the SQL file must be connected to a database connection profile. If not connected, you can use SQL Editor or the Attach Tool button to connect.
In SQL Editor, open a SQL file or procedural object.
Select the statement or statements for which you want to display an execution plan.
Right-click in SQL Editor and select Get Execution Plan. The SQL statement executes.
Double-click the table icon on the left of the Get Execution Plan tab. Two frames open:
A frame that displays a graphical representation (ASA only, ASE provides text display) of the SQL statements you have selected.
A frame that displays useful statistics such as rows returned, runtime, CPU time, and disk read/write times; and various options used, such as case sensitivity, character set, date format, encryption, histograms, start time, and thread count.
Set the Show Plan while executing SQL Statements option in Preferences to get the Query Plan while the execution is taking place. See Setting Database Development Main Preferences for more information.
Send your feedback on this help topic to Sybase Tech Pubs: pubs@sybase.com