Thursday, 12 April 2012

SQL server: Deciphering Wait resource

When I was working with couple of frequent blocking issue in our live server, I have noticed different types of wait resources which are not meaningful unless they mapped to a table or an index. In this post I will explain how to map the wait resources to table/index.

Key Wait Resource 

Below is a sample of blocked process report with Key as wait resource .

The first part of the key wait resource is the database id and second part is called as Hobt_Id. Hobt is an acronym for Heap Or B Tree. The hobt_id can be mapped to sys.indexes and sys.objects through sys.partitions. Below script will map the key wait resource to corresponding index and table.

SELECT AS TableName AS IndexName,
SCHEMA_NAME(o.schema_id) AS SchemaName
FROM sys.partitions p JOIN sys.objects o ON p.OBJECT_ID = o.OBJECT_ID 
JOIN sys.indexes i ON p.OBJECT_ID = i.OBJECT_ID  AND p.index_id = i.index_id 
WHERE p.hobt_id = 72057594040811520

Page Wait Resource 

Below is a sample of blocked process report with Page as wait resource .

As everyone knows, the first part of the wait resource is the database id (68)  , second part is file id (1)  and third part is the page number(492478). To find out the object id associated with this page follow the below steps.

Select the database based on the output above statement. Then execute the below statement
DBCC traceon (3604)
DBCC page (68, 1, 492478) --Database_id,file_id,page_id

This will give a result as given below.

The object id can be mapped to a table using  the system function  object_name()

Object Wait Resource 

Below is a sample of blocked process report with Object as wait resource .

Here also the first part of the wait resource is the database id(68) ,second part is the object id and third part is known as lock partition id. The object id part can be mapped to an object using the object_name() system function . The lock partition id is not very useful in troubleshooting the blocking issue.This will have positive value only when the server has more than 16 CPU. I will explain more about the lock partition in my  future post.

If you liked this post, do like my page on FaceBook at


  1. I am fresher leaning SQL and this site has some very informative stuff! Sample Statements

  2. Very nice. Thanks

  3. This page has become a standard reference for me whenever investigating blocking and deadlocks. Thanks for your fine work :)

  4. Hey, this article has helped a BUNCH! There are few things i do not understand in the blocked process report. However i cannot find any info on what XDES means and what it is telling me. Any ideas?


  5. Thanks for posting this useful content, Good to know about new things here, Let me share this, . LINUX training in pune


  6. I loved the way you discuss the topic great work thanks for the share, Let me share this, dotnet training in pune

  7. a pride for me to be able to discuss on a quality website because I just learned to make an article on
    cara menggugurkan kandungan

  8. شركة تنظيف منازل بجدة
    شركة تنظيف منازل بمكة
    افضل شركة تنظيف بجدة
    شركة تنظيف خزانات بالمدينة المنورة
    شركة صيانة خزانات بجدة
    يحتاج الخزان إلى عناية متخصصة من تنظيف و تعقيم كل خمسة أشهر و هذا لن يتم إلا بالاستعانة بشركة تنظيف خزانات بجدة ولو انت في المدينة المنورة فتحتاج الى شركة غسيل خزانات بالمدينة وذلك لامتلاكهم السبل و الأساليب اللازمة لذلك كما أن لديهم خبراء و متخصصين في مجال تنظيف الخزانات بجدة و تنظيف الخزانات بالمدينة المنورة وتشمل العناية الآتي :
    عناية يدوية : عن طريق نزول العمال إلى الخزان و فركه جيدا و تنظيف جدرانه و الأسطح الخاصة به باستخدام المساحيق المنظفة الفعالة و اللازمة لهذه العملية .
    عناية ميكانيكية : عن طريق استخدام مكانس المياه و الخراطيم النفاسة لإزالة الرواسب و البكتريا . عندما يتواجد فتحة مناسبة يستطيع العمال الدخول إلى الخزان و تنظيفه جيدا من الداخل باستخدام فرشاة خشنة ثم ملأ المياه و تفريغها للتأكد من نظافته و في حالة الخزانات الصغيرة يتم الاكتفاء بتوجيه مكانس المياه أو مضخاتها إلى داخل الخزان لإزالة الأوساخ و الترسبات ثم ملأ و تفريغ المياه عدة مرات للتأكد من نظافته وذلك في شركة صيانة خزانات بجدة متميزة وخبرة

  9. We are offering Social media training courses in Bangalore with Live projects and social tools. Learn to increase your business awareness through various social media channels. Please visit our website to know more information.