(Republishing, or using this info in a commercial product/website, is prohibited without permission. All other uses are permitted. If in doubt, please ask.)
This latch class, along with NESTING_TRANSACTION_FULL, is used to control access to the transaction description structure (called an XDES) for the parent transaction of a parallel nested transaction. A query that involves a parallel operator must start a sub-transaction for each parallel thread that is used, so these transactions are sub-transactions (called parallel nested transactions) of the main transaction. The _READONLY is for a transaction that’s read-only, i.e. it hasn’t changed the database.
This latch class replaced the NESTED_TRANSACTION_READONOY latch class from SQL Server 2008 onward.
(Books Online description: “Internal use only.”)
Questions/comments on this latch class? Click here to send Paul an email, especially if you have any information to add to this topic.
Added in SQL Server version:
Removed in SQL Server version:
Extended Events latch_class value:
Maps to the TRAN_NESTING_RO map_value in sys.dm_xe_map_values.
The map_key value in sys.dm_xe_map_values is 112 in 2008 and 2008 R2, and 109 in 2012 and 2014 RTM. After 2014 RTM, you must check the DMV to get the latest value as some map_key values have changed in later builds.
These latches indicate that parallelism is happening, so for contention issues, follow the general steps for troubleshooting parallelism problems (see the CXPACKET wait type). I’ve heard anecdotal evidence that these latches can be problematic under certain circumstances when RCSI (read-committed snapshot isolation) is enabled, and there is a known bug (fixed) in SQL Server 2012 and 2014 that is described in KB 2806979.
See the LATCH_EX wait type for more information about latches in general and how to troubleshoot them.
Known occurrences in SQL Server (list number matches call stack list):
- Creating a rowset (a way of transferring rows from the Storage Engine to the Query Processor) (in this case, for a parallel table scan)
- Creating a rowset (in this case, as part of processing a sort for a top-N select)
And many, many more similar stacks.
Abbreviated call stacks (list number matches known occurrences list):