onstat -g ssc command: Print SQL statement occurrences
Use the onstat -g ssc command to monitor the number of times that the database server reads the SQL statement in the cache.
By default, only the DBSA can view onstat -g ssc syssqltrace
information. However, when the UNSECURE_ONSTAT configuration parameter
is set to 1
, all users can view this information.
The all option reports the key-only cache entries as well as the fully cached statements. If the value in the hits column is less than the STMT_CACHE_HITS value, that entry is a key-only cache entry. For more information, see memory utilization in the Informix® Performance Guide.
The pool option reports usage of all memory pools for the SQL statement cache. The output displays information on the name, class, address, and total size of the memory pools. For more information, see improving query performance in the Informix® Performance Guide.
Example output
Output description - Statement Cache Summary section
- #lrus
- Number of least recently used queues (LRUS)
- currsize
- Current® cache size
- maxsize
- Limit on total cache memory
- Poolsize
- Total pool size
- #hits
- The number of hits before insertion. This number equals the value of the STMT_CACHE_HITS configuration parameter
- nolimit
- The value of the STMT_CACHE_NOLIMIT configuration parameter
Output description - Statement Cache Entries section
- lru
- The index of lru queue to which the cache entry belongs
- hash
- Hash values of cached entry
- ref_count
- Number of threads referencing the statement
- hits
- Number of times a statement matches a statement in the cache. The match can be for a key-only or fully cached entry.
- flag
- Cache entry flag
-D
indicates that the statement is dropped,-F
indicates that the statement is fully cached, and-I
indicates that the statement is in the process of being moved to a fully cached state - heap_ptr
- Address of memory heap for cache entry