PAGEIOLATCH_EX Wait Type in SQL Server

⏳Part of the SQL Server Wait Types Library, every wait type explained.Related pillar: Storage & Capacity

PAGEIOLATCH_EX means a session is waiting for a data page to be read from disk into memory so that it can change it. It is a read wait that belongs to UPDATE, DELETE, INSERT and MERGE statements, not SQL Server writing dirty pages out. When it climbs, your write statements are touching data that is not in the buffer pool, and the reads to fetch it are slow or numerous.

Its partner PAGEIOLATCH_SH is the same disk read for a page that will only be read. Both point at the read path of the data files.


PAGEIOLATCH_SH vs PAGEIOLATCH_EX

Wait typeThe page is read in toTypical statementsMeans
PAGEIOLATCH_SHBe readSELECT, reports, the read side of a joinCold reads, a working set larger than memory, or slow storage
PAGEIOLATCH_EXBe modifiedUPDATE, DELETE, INSERT, MERGE, index maintenanceThe rows a write needs are not cached, so the write waits for a read first

Microsoft’s I/O troubleshooting article describes the exclusive mode as the one used “when the buffer is being written to disk”, which is why this wait is often blamed on checkpoint. The lab counts did not repeat, so no table is shown. On a SQL Server 2025 lab instance with the buffer pool emptied first, a cold UPDATE of every row in a 20,000-row table recorded thousands of exclusive waits in one run and 1 in a repeat, while the CHECKPOINT that wrote the dirty pages out recorded 2 both times. Read the explanation above as how to interpret the wait, not as a benchmark you should expect to reproduce.

The reasoning for a read rather than a write is that checkpoint and the lazy writer write asynchronously, so sessions do not normally wait for them, and the 2 waits from the CHECKPOINT fit that. Slow writes of data pages show up in avg_write_ms below and in the Perfmon counter Avg. Disk sec/Write, not in this wait.


Is This Wait Expected?

Some is normal on any server that changes data, because not every page a write touches will be cached. It becomes worth chasing when:

  • It is in your top waits over an interval, not just since the last restart (interval vs cumulative)
  • avg_wait_ms stays above about 10 to 15 ms, the range documented as an I/O bottleneck
  • It rises with large updates, deletes, ETL loads or index maintenance over older data and falls when they finish

Treat those figures as starting points. Baseline this wait on your own hardware during a normal week; the thresholds worth acting on are the ones your workload proves.


Root Causes

Write statements touching cold data. A large UPDATE or DELETE over last year’s rows, an archive job or an ETL merge reads pages nobody has needed for weeks. Each one has to come off disk before it can be changed.

No index on the predicate of a big update or delete. Without one, the statement scans the table to find its rows and reads every page into memory first. An index on the WHERE column cuts the pages read to the ones that change. Get Missing Indexes often names it.

A buffer pool too small for the data being changed. When memory cannot hold the working set, pages are evicted and read back repeatedly. Check max server memory against the RAM on the box with Get Memory Configuration and Usage.

Random-key inserts. A clustered index on a GUID or another non-sequential key spreads inserts across the whole index. Each insert can land on a page that is not cached, so it reads before it writes, and page splits add more pages to read and change.

Slow reads from the data files. Every cause above becomes visible because each read takes too long. Storage latency on the data files multiplies all of them.


How To Diagnose It

Check data file read latency:

SELECT
    DB_NAME(vfs.database_id) AS database_name,
    mf.physical_name,
    vfs.num_of_reads,
    CASE WHEN vfs.num_of_reads > 0
         THEN CAST(vfs.io_stall_read_ms * 1.0 / vfs.num_of_reads AS decimal(10,1))
         ELSE 0
    END AS avg_read_ms,
    vfs.num_of_writes,
    CASE WHEN vfs.num_of_writes > 0
         THEN CAST(vfs.io_stall_write_ms * 1.0 / vfs.num_of_writes AS decimal(10,1))
         ELSE 0
    END AS avg_write_ms
FROM sys.dm_io_virtual_file_stats(NULL, NULL) AS vfs
JOIN sys.master_files AS mf
    ON mf.database_id = vfs.database_id
    AND mf.file_id = vfs.file_id
WHERE mf.type_desc = 'ROWS'
ORDER BY vfs.io_stall_read_ms DESC;
Get-WaitStatistics output in the dba-tools terminal and web UI

High avg_read_ms on the data files, above 10 to 15 ms regularly, confirms the reads are slow. A high avg_write_ms is a separate write-path problem; Get Database I/O Usage shows both per database.

See which statements are waiting right now:

SELECT
    r.session_id,
    r.command,
    r.wait_time AS wait_ms,
    r.wait_resource,
    DB_NAME(r.database_id) AS database_name,
    SUBSTRING(t.text, (r.statement_start_offset / 2) + 1,
        ((CASE r.statement_end_offset WHEN -1 THEN DATALENGTH(t.text)
          ELSE r.statement_end_offset END - r.statement_start_offset) / 2) + 1) AS current_statement
FROM sys.dm_exec_requests AS r
CROSS APPLY sys.dm_exec_sql_text(r.sql_handle) AS t
WHERE r.wait_type = 'PAGEIOLATCH_EX';

wait_resource names the database, file and page being read. A run of UPDATE or DELETE rows on the same table is the statement to tune.

Measure one statement: run it, then this in the same session, and compare before and after:

-- run in the same session as the statement you want to measure
SELECT wait_type, waiting_tasks_count, wait_time_ms
FROM sys.dm_exec_session_wait_stats
WHERE session_id = @@SPID
  AND wait_type LIKE 'PAGEIOLATCH%';

Check leaf page allocations, the closest proxy for page splits:

SELECT
    OBJECT_NAME(i.object_id, DB_ID()) AS table_name,
    i.name AS index_name,
    i.fill_factor,
    ps.leaf_insert_count,
    ps.leaf_allocation_count,
    CAST(100.0 * ps.leaf_allocation_count /
        NULLIF(ps.leaf_insert_count + ps.leaf_allocation_count, 0) AS decimal(5,1)) AS leaf_alloc_pct
FROM sys.dm_db_index_operational_stats(DB_ID(), NULL, NULL, NULL) AS ps
JOIN sys.indexes AS i ON i.object_id = ps.object_id AND i.index_id = ps.index_id
WHERE ps.leaf_allocation_count > 0
ORDER BY ps.leaf_allocation_count DESC;

sys.dm_db_index_operational_stats has no split counter, so there is no direct page-split number to read. leaf_allocation_count counts new leaf pages, which is splits plus ordinary growth at the end of the index, so read it as an upper bound rather than a split count. A high leaf_alloc_pct on a table under heavy insert load still points at GUID or other non-sequential keys.


What To Do

Index the predicate of large updates and deletes. Fewer pages read means fewer waits, and it is the fix that removes the reads rather than speeding them up.

Move big changes to cold data off-peak. Archive jobs, purges and backfills read old pages by design. Run them when they are not competing with production reads, and in batches so each one finishes quickly.

Give the buffer pool enough memory. If pages are being evicted and read back, more memory for SQL Server keeps the changing data cached. Leave the operating system room to work.

Use sequential keys for insert-heavy tables. IDENTITY, a SEQUENCE or NEWSEQUENTIALID() keeps inserts on the last page, which stays in memory. A fill factor below 100 trades space for fewer splits where the key cannot change.

Faster storage for the data files. If reads are slow at the file level, moving data files to SSD or NVMe shortens every one of these waits.

Two write-side fixes often suggested for this wait help a different one. File growth without instant file initialisation waits on PREEMPTIVE_OS_WRITEFILEGATHER while the new space is zeroed, and checkpoint tuning changes write bursts, which this wait does not measure.


Where To Go Next

If PAGEIOLATCH_EX is sitting near the top of your wait stats, these are the next places to look.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *