Applies To: SQL Server 2014, SQL Server 2016 Preview
Returns page allocation and deallocation activity by task for the database.
This view is applicable only to the tempdb database.
Applies to: SQL Server (SQL Server 2008 through current version), SQL Database V12, Azure SQL Data Warehouse Public Preview.
To call this from SQL Data Warehouse, use the name sys.dm_pdw_nodes_db_task_space_usage.
Request ID within the session.
A request is also called a batch and may contain one or more queries. A session may have multiple requests active at the same time. Each query in the request may start multiple threads (tasks), if a parallel execution plan is used.
Execution context ID of the task. For more information, see sys.dm_os_tasks (Transact-SQL).
Number of pages reserved or allocated for user objects by this task.
Number of pages deallocated and no longer reserved for user objects by this task.
Number of pages reserved or allocated for internal objects by this task.
Number of pages deallocated and no longer reserved for internal objects by this task.
On SQL Server requires VIEW SERVER STATE permission on the server.
On SQL Database Premium Tiers requires the VIEW DATABASE STATE permission in the database. On SQL Database Standard and Basic Tiers requires the SQL Database admin account.
IAM pages are not included in any of the page counts reported by this view.
Page counters are initialized to zero (0) at the start of a request. These values are aggregated at the session level when the request is completed. For more information, see sys.dm_db_session_space_usage (Transact-SQL).
Work table caching, temporary table caching, and deferred drop operations affect the number of pages allocated and deallocated in a specified task.
The following objects are included in the user object page counters:
User-defined tables and indexes
System tables and indexes
Global temporary tables and indexes
Local temporary tables and indexes
Tables returned in the table-valued functions
Internal objects are only in tempdb. The following objects are included in the internal object page counters:
Work tables for cursor or spool operations and temporary large object (LOB) storage
Work files for operations such as a hash join