Index block hitrate


Job details

Name: Index block hitrate
Platform: Postgres
Category: Performance
Description: Checks the hitrate for index disk block requests.
Long description: Task checks the hitrate for index disk block requests.
Version: 1.5
Default schedule: 7,37 * * *
Requires engine install: Yes
Compatibility tag: .[type=‘instance’ & databasetype=‘postgres’]/.[hasengine=‘YES’]

Parameters

Name Default value Description
warning threshold 50 Will give a warning if the hit ratio falls below this value (in %).
alarm threshold 25 Will give an alarm if the hit ratio falls below this value (in %).
keep data for 7 The number of days to keep the data for.

Job Summary

select sum(idx_blks_read), sum(idx_blks_hit) from pg_statio_user_indexes;

Implementation Details

The monitoring job is implemented through several SQL statements and a PL/pgSQL function:

Dependency Management

The job relies on the following objects:

Should there be a failure, cleanup processes are triggered to ensure the integrity and cleanup of dependent objects.

Reporting and Visualization

The job includes detailed report templates that provide visual insights into the hit rates:

Report Section Description
Index block hitrate Displays the hit rate over time with a line chart.
Index block reads Compares the actual counts of disk reads and cache hits over time with a color-coded bar chart.

This structured reporting helps in quick assessment and decision-making based on the visual trends and historical performance data.

Scheduling and Execution