Use the polar_stat_io_info and polar_stat_io_latency views to diagnose I/O performance at the file level — including operation counts, throughput, and latency distributions broken down by file type and I/O kind.
Prerequisites
Before you begin, ensure that you have:
The
polar_monitorextension installed in the database
To install the extension, run:
CREATE EXTENSION polar_monitor;I/O statistics view
polar_stat_io_info answers the question: how much I/O is happening, and how long is it taking? Query this view to find which file type is generating the most read or write traffic, or which operation is accumulating the most latency.
| Column | Type | Description |
|---|---|---|
filetype | text | The file type, such as WAL, DATA, and LOG. |
fileloc | text | The local file. |
open_count | numeric | Number of file open operations. |
open_latency_us | double precision | Total latency of file open operations, in microseconds. |
close_count | numeric | Number of file close operations. |
read_count | numeric | Number of file read operations. |
write_count | numeric | Number of file write operations. |
read_throughput | numeric | Total bytes read. |
write_throughput | numeric | Total bytes written. |
read_latency_us | double precision | Total latency of read operations, in microseconds. |
write_latency_us | numeric | Total latency of write operations, in microseconds. |
seek_count | numeric | Number of file seek operations. |
seek_latency_us | double precision | Total latency of seek operations, in microseconds. |
creat_count | numeric | Number of file create operations. |
creat_latency_us | double precision | Total latency of file create operations, in microseconds. |
fsync_count | numeric | Number of fsync operations. |
fsync_latency_us | double precision | Total latency of fsync operations, in microseconds. |
falloc_count | numeric | Number of falloc operations. |
falloc_latency_us | double precision | Total latency of falloc operations, in microseconds. |
I/O latency distribution view
polar_stat_io_latency answers the question: where does latency concentrate? Instead of an average, it shows how many operations completed within each latency bucket, making it easier to detect tail latency.
| Column | Type | Description |
|---|---|---|
iokind | text | The I/O operation type, such as OPEN, CREATE, READ, and WRITE. |
num_lessthan200us | numeric | Operations that completed in less than 200 microseconds. |
num_lessthan400us | numeric | Operations that completed in less than 400 microseconds. |
num_lessthan600us | numeric | Operations that completed in less than 600 microseconds. |
num_lessthan800us | numeric | Operations that completed in less than 800 microseconds. |
num_lessthan1ms | numeric | Operations that completed in less than 1 millisecond. |
num_lessthan10ms | numeric | Operations that completed in less than 10 milliseconds. |
num_lessthan100ms | numeric | Operations that completed in less than 100 milliseconds. |
num_morethan100ms | numeric | Operations that took longer than 100 milliseconds. |