Neoview SQL Reference Manual (R2.5)
prepared-stmt-name
an SQL identifier containing the name of a statement already prepared in this session. An
SQL identifier is case-insensitive (will be in uppercase) unless it is double-quoted. It must
be double-quoted if it contains blanks, lowercase letters, or special characters. It must start
with a letter. When you refer to the prepared query in a SELECT statement, you must use
uppercase.
Considerations for EXPLAIN
• “Case Considerations” (page 125)
• “Number Considerations” (page 125)
• “Formatted [OPTIONS 'f'] Considerations” (page 125)
• “Normal User [OPTIONS 'n'] Considerations” (page 126)
• “Expert User [OPTIONS 'e'] Considerations” (page 128)
• “Machine-Readable [OPTIONS 'm'] Considerations” (page 130)
Obtaining EXPLAIN Plans While Queries Are Running
Neoview SQL provides the ability to capture an EXPLAIN plan for a query at any time while
the query is running with the FOR QID option. By default, this behavior is disabled for a Neoview
session. To enable this feature, please contact your HP Support representative for assistance.
NOTE: Enable this feature before you start preparing and executing queries.
After the feature is enabled, use the FOR QID option in an EXPLAIN statement to get the query
execution plan of a running query.
The EXPLAIN function or statement returns the plan that was generated when the query was
prepared. EXPLAIN with the FOR QID option retrieves all the information from the original
plan of the executing query. The plan is available until the query finishes executing and is removed
or deallocated.
Case Considerations
In most cases, words in the commands can be in uppercase or lowercase. The options letter must
be single quoted and in lowercase.
Number Considerations
Costs are given in a generic unit of effort. They show relative costs of an operation.
When numbers are displayed as 0.01 for OPTIONS ‘n’ (or 0.0001 for OPTIONS ‘e’), the numbers
have likely been rounded up and are usually much smaller than shown. However, if the numbers
are zero, the display shows “0”.
When trailing decimal digits are zero, they are dropped. For example, 6.4200 would display as
6.42 and 5.0 would display as 5, without a decimal point.
Formatted [OPTIONS 'f'] Considerations
The formatted option is the simplest option. It provides essential, brief information about the
plan and shows the operators and their order within the query execution plan.
OPTIONS 'f' formats the EXPLAIN output into these fields:
Left child sequence numberLC
Right child sequence numberRC
The sequence number of the operator in the query planOP
EXPLAIN Statement 125