Monitoring the Statement Cache

sp_sysmon reports on statement caching and stored procedure executions.

The statement cache is monitored by these counters:
  • Statements Cached – the number of SQL statements added to the cache. This is typically the same number as Statements Not Found. Smaller values for statements cached means the statement cache is full of active statements.

  • Statements Found in Cache – the number of times a query plan was reused. A low number of cache hits may indicate the statement cache is too small.

  • Statements Not Found – indicates a lack of repeated SQL statements. The sum of statements found in cache and statements not found is the total number of eligible SQL statements submitted.

  • Statements Dropped – the number of statements that were dropped from the cache. A high value may indicate an insufficient amount of procedure cache memory, or the statement cache size is too small.

  • Statements Restored – the number of query plans regenerated from the SQL text. High values indicate an insufficient procedure cache size.

  • Statements Not Cached – the number of statements SAP ASE would have cached if the statement cache were enabled. However, Statements Not Cached does not indicate how many unique SQL statements would be cached.

For example, this is sample output from sp_sysmon:
SQLStatement Cache:
   Statements Cached                 0.0           0.0           0        n/a
   Statements Found in Cache         0.7           0.0           2        n/a
   Statements Not Found              0.0           0.0           0        n/a
   Statements Dropped                0.0           0.0           0        n/a
   Statements Recompiled             0.3           0.0           1        n/a
   Statements Not Cached             1.3           0.0           4       n/a