SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

PAGELATCH Waits with Update Statements in SQL Server – PAGELATCH_EX and PAGELATCH_SH

In SQL Server, concurrent writes or read / write to the same page can lead to PAGELATCH (like PAGELATCH_EX and PAGELATCH_SH) waits or what is knowns as PAGELATCH contention.

One common use case is when invoice numbers are stored in a table. If the row is narrow, then many rows can fit in the 8KB page. This can lead to many invoicing number sequences being stored on the same page. When different invoicing number sequences are accessed from concurrent sessions, this can lead to PAGELATCH waits.

The way to solve this is to widen the rows so each row takes about a page and we don’t have contention on the same page.

The below video demonstrates this with hands-on example. SQLTest Tool simulates the hands-on labs for you, no registration necessary. You can practice the online hands-on example while watching the video.

Check out www.sqlvideo.com for additional hands-on videos.

Subscribe to our newsletter: https://newsletter.sqlworkshops.com

Ramesh Meyyappan’s SQL Server Performance Tuning Blog

Ramesh Meyyappan (www.sqlworkshops.com) is a SQL Server specialist with expertise in Performance Tuning. Ramesh worked at Microsoft Corporation from 1994 to 2004. Nearly half of that time he worked in Redmond in the development teams - specifically as Program Manager in the SQL Server Development Team responsible for optimizing SQL Server product for SAP. Ramesh now offers onsite and offsite consulting and workshops independently as well as by partnering with various Microsoft Subsidiaries. LinkedIn Profile: http://de.linkedin.com/in/rmeyyappan.

Comments

Leave a comment on the original post [blog.sqlworkshops.com, opens in a new window]

Loading comments...