Query Plan Settings
Two SQL statements let you control whether you want to create a query plan and what name to give the plan. Both statements apply only to the SQL session.
You can execute the statements in Pervasive PSQL Control Center or from any utility that can send SQL statements to the Pervasive PSQL database engine.
Table 199
Query Plan SQL Statements for Settings
SQL Statement
Discussion
SET QRYPLAN=<on | off>
Instructs the database engine to create a query plan for use with Query Plan Viewer, or not.
SET QRYPLANOUTPUT=<NULL |
file_name
>
Sets the location and name of the query plan file. NULL specifies not to create a query plan file.
A single query plan output file can contain plans resulting from multiple queries.
By default, Query Plan Viewer looks for a file name extension of "qpf." You may use whatever file name extension you want, or omit one.
Example: You want to create a query plan named "select_salary" and store the query plan file in a directory named "mydirectory" on drive D off of the root:
SET QRYPLANOUTPUT='d:\mydirectory\select_salary.qpf'
The database engine creates the query plan output file, so the path must be a location on the machine where the database engine is running. The path should not reference client-side locations or client drive mappings.
See also
Examining Query Plans and Evaluating Query Performance
.