EasyManua.ls Logo

Sybase Adaptive Server Anywhere - EXPLAIN Statement [ESQL]

Sybase Adaptive Server Anywhere
1182 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Chapter 9 SQL Statements
521
EXPLAIN statement [ESQL]
Use this statement to retrieve a text specification of the optimization strategy
used for a particular cursor.
EXPLAIN PLAN FOR CURSOR
cursor-name
INTO
host-variable
INTO
host-variable
| USING DESCRIPTOR
sqlda-name
cursor-name
:
identifier
or
host-variable
sqlda-name
:
identifier
Must have opened the named cursor.
None.
"DECLARE CURSOR statement" on page 488
"PREPARE statement" on page 578
"FETCH statement" on page 523
"CLOSE statement" on page 416
"OPEN statement" on page 570
"Cursors in Embedded SQL" on page 33 of the book ASA Programming
Interfaces Guide
"The SQL Communication Area" on page 27 of the book ASA Programming
Interfaces Guide
The EXPLAIN statement retrieves a text representation of the optimization
strategy for the named cursor. The cursor must be previously declared and
opened.
The host-variable or sqlda-name variable must be of string type. The
optimization string specifies in what order the tables are searched, and also
which indexes are being used for the searches if any.
This string may be long, depending on the query, and has the following
format:
table (index), table (index), ...
If a table has been given a correlation name, the correlation name will appear
instead of the table name. The order that the table names appear in the list is
the order in which they will be accessed by the database server. After each
table is a parenthesized index name. This is the index that will be used to
access the table. If no index will be used (the table will be scanned
sequentially) the letters "seq" will appear for the index name. If a particular
SQL SELECT statement involves subqueries, a colon (:) will separate each
subquery’s optimization string. These subquery sections will appear in the
order that the database server executes the queries.
Function
Syntax
Permissions
Side effects
See also
Description

Table of Contents

Related product manuals