Reports the number of pages reserved to a table, index or a specific partition. The result includes pages used for internal structures.
This function replaces the old reserved_pgs function used in Adaptive Server versions earlier than 15.0.
reserved_pages(dbid, object_id [, indid [, ptnid]])
is the database ID of the database where the target object resides.
is an object ID for a table.
is the index ID of target index.
is the partition ID of target partition.
Returns the number of pages reserved by the object with a object ID of 31000114 in the specified database (including any indexes):
select reserved_pages(5, 31000114)
Returns the number of pages reserved by the object in the data layer, regardless of whether or not a clustered index exists:
select reserved_pages(5, 31000114, 0)
Returns the number of pages reserved by the object in the index layer for a clustered index. This does not include the pages used by the data layer:
select reserved_pages(5, 31000114, 1)
Returns the number of pages reserved by the object in the data layer of the specific partition, which in this case is 2323242432:
select reserved_pages(5, 31000114, 0, 2323242432)
In the case of an apl table, if a clustered index exists on the table, then passing in an in did of 0 will report the reserved data pages, and passing an indid of 1 will report the reserved index pages. All erroneous conditions will result in a value of zero being returned.
ANSI SQL – Compliance level: Transact-SQL extension.
Any user can execute reserved_pgs.
Command update statistics
Function data_pages, reserved_pages, row_count, used_pages
Copyright © 2005. Sybase Inc. All rights reserved. |