Try OpenEdge Now
skip to main content
Debugging and Troubleshooting
Troubleshooting Resources : Log Entry Types Detail : Query information logging : Query statistics
 
Query statistics
Query statistics provide information on the query as it extracts data from the database. That is, on the retrieval of records during the query. This information is intended to help you evaluate query performance.
For the purposes of gathering statistics, queries fall into either of two categories:
*Pre-pass queries — Queries that build a result-list completely, in one ABL statement, before going on to the next ABL statement. The AVM builds the result-list at different times for different types of queries. These queries include:
*Static and dynamic queries that perform sorting or pre-fetching. (The AVM builds a complete result-list only on the first GET NEXT statement or GET-NEXT() method executed.)
*Static PRESELECT statements. The AVM builds a complete result-list on the PRESELECT statement.
*FOR statements that sort on the client and build a list of results in a sort file. The AVM builds a complete result-list on the FOR EACH statement.
*Non-pre-pass queries — Queries that do not build a result-list completely before executing the next ABL statement. These queries include FOR EACH statements and queries that sort by an index, enabling the server to identify the next record from the index, without any sorting by the client.
Between record retrievals, the client steps through ABL statements in an iterating block, for example, between a FOR EACH and its corresponding END statement. In cases where the client is selecting the records, only fetches involving records that satisfy selection criteria iterate through the loop.
Query information logging logs different information depending on whether the query is a pre-pass query or a non-pre-pass query. Both pre-pass and non-pre-pass queries write statistics when the query is complete. A query is considered complete at the following points in the code:
*For FOR and static PRESELECT statements, at the end of the block (the END statement). Any statements that cause a premature exit from the block still result in end-of-block processing, and the logging of query statistics.
*For static and dynamic queries, when the AVM closes the query. The following are examples of when the AVM closes the query:
*On a CLOSE QUERY statement or QUERY-CLOSE() method
*On a OPEN QUERY statement or QUERY-OPEN() method if the query is already open
*When the query goes out of scope, that is, the program containing the query exits
*When a program deletes a buffer used by a dynamically opened query
* Query statistics for pre-pass queries
* Query statistics for non-pre-pass queries
* Query preparation statistics
* Number of records sent by the server
* Number of available records in the query
* Time taken to build a result-list
* Field list information
* Database block access
* Read Access Statistics