SQL/MX 2.x Reference Manual (H06.04+)

SQL/MX Functions and Expressions
HP NonStop SQL/MX Reference Manual540440-003
9-112
QUERYCACHEENTRIES Function
QUERYCACHEENTRIES Function
The query plan cache automatically collects statistics on each entry of the cache.
When invoked, the QUERYCACHEENTRIES table-valued function collects and returns
these statistics in a table with one row for each entry of the cache. The statistics are
reinitialized when an mxcmp session is started. Each mxcmp session maintains an
independent set of statistics.
The QUERYCACHEENTRIES function is an SQL/MX extension.
The QUERYCACHEENTRIES function can be specified as a table reference (table)
in the FROM clause of a SELECT statement if it is preceded by the keyword TABLE
and surrounded by parentheses. The syntax for the QUERYCACHEENTRIES function
has no parameters.
In a dynamic environment (that is, MXCI, MXCS, JDBC, or dynamic SQL), the
QUERYCACHEENTRIES function returns the statistics of each entry of the query plan
cache of the mxcmp associated with the dynamic session. In a static environment (that
is, statically compiled embedded SQL), the QUERYCACHEENTRIES function returns
zero rows because at runtime there is no associated mxcmp.
Considerations for QUERYCACHEENTRIES
Using QUERYCACHEENTRIES and DISPLAY_QC_ENTRIES
The result of the QUERYCACHEENTRIES function can be generated and displayed
either by using the QUERYCACHEENTRIES function or the DISPLAY_QC_ENTRIES
command. The DISPLAY_QC_ENTRIES command displays a subset of the
information contained in the QUERYCACHEENTRIES function. The output for the
QUERYCACHEENTRIES function and DISPLAY_QC_ENTRIES is machine-readable
format. See the DISPLAY_QC_ENTRIES Command
on page 4-20.
QUERYCACHEENTRIES ()