Data hit ratio


Job details

Name: Data hit ratio
Platform: Sqlserver
Category: Performance
Description: Monitors the buffer cache hit ratio by extracting counter values from the master.dbo.sysperfinfo table for the counters ‘Buffer cache hit ratio’ and ‘Buffer cache hit ratio base’.
Long description: Monitors the buffer cache hit ratio by extracting counter values from the master.dbo.sysperfinfo table for the counters ‘Buffer cache hit ratio’ and ‘Buffer cache hit ratio base’.
Version: 1.8
Default schedule: 0,10,20,30,40,50 * * *
Requires engine install: Yes
Compatibility tag: .[type=‘instance’ & databasetype=‘sqlserver’]/instance[maj_version > ‘1999′ & hasengine=‘YES’ & (engine_edition = ‘Microsoft SQL Server’ engine_edition = ‘Azure SQL Managed Instance’)]

Parameters

Name Default value Description
keep data for 3 Number of days to provide statistics for.

Job Summary

SELECT cntr_value AS 'Buffer cache hit ratio' FROM master.dbo.sysperfinfo WHERE counter_name = 'Buffer cache hit ratio'

Implementation Details

The job is implemented through various SQL statements that:

Here is a brief overview of the tasks carried out by the SQL procedures:

  1. Monitoring increases in logical read periods and updating corresponding statistics.
  2. Aggregating and recording average, maximum, and minimum hit ratios and logical reads for distinct time intervals (whole day, working hours, non-working hours, evenings).
  3. Handling database maintenance tasks such as cleaning historical data based on the configured retention period.

Dependencies and Database Objects

The job setup involves several database objects including tables and stored procedures created in the SQL Server instance to support the data gathering and reporting functionality. Key object dependencies include:

Job Scheduling

The job is configured to run at a regular interval:

Reporting and Presentation

The output from this monitoring job can be visualized and reported traditionally via SQL Server reporting services or other third-party tools that can consume SQL data. Reporting templates defined as part of the dbWatch task facilitate easy visualization content that includes:

The reports use both tabulated data views and graphical presentations (charts) based on the stored statistical data, providing DBAs with clear insights into performance trends and helping in proactive database management.