A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z  special characters  sybase-tech-blog


Category: ASE: Functions: System Functions

reserved_pages()

The system function reserved_pages() returns the number of server pages allocated to a table, index or partition. The return value also contains pages used for ASE internal structures. The system function "reserved_pages()" replaces the function reserved_pgs(). starting with ASE version 15.0. The function "reserved_pages()" can be executed by any user.

Syntax of the System Function reserved_pages()

    reserved_pages(dbid, object_id [, indid [, ptnid]])
    

The parameter of the System Function reserved_pages()

"dbid"
The parameter "dbid" is the identification number of the database, in which the target object is stored. The dbid of a database can be found in the column dbid of the system table sysdatabases. "object_id"
The parameter "object_id" describes an identification number of a table to be queried. The "object_id" is located in the column id of the system table sysobjects. "indid"
The optional parameter "indid" describes the identification number of the index to be queried. The "indid" can be retrieved from the column "indid" of the system table sysindexes. "ptnid"
The optionale parameter "ptnid" is the identification number of the desired partition. The "ptnid" is stored in the column partitionid of the system table syspartitions.

Example for the System Function reserved_pages()

    select reserved_pages(2, 31000200)
    

The return value is the number of server pages allocated to the object with the id "31000114", stored in the database with the id "5", including all index pages.

    select reserved_pages(2, 31000200, 0)
    

The return value is the number of pages allocated to the data segment of the object with the id "31000200", stored in the database with the id "5". Possibly existing index pages are not counted.

    select reserved_pages(2, 31000200, 0)
    

The return value corresponds to the number of pages allocated to the index segment of a clustered Index for an object without the the number of pages allocated to the data segment.

    select reserved_pages(2, 31000200, 0, 4545454567)
    

The return value is the number of pages allocated to the data segment of the partition with the id "4545454567".

See also:

ASE T-SQL - Aggregate Functions,
audit_event_name(),
col_length(),
col_name(),
curunreservedpgs(),
datachange(),
datalength(),
data_pages(),
data_pgs(),
db_id(),
db_name(),
host_id(),
host_name(),
identity(),
index_col(),
index_colorder(),
isnull(),
lct_admin(),
license_enabled(),
lockscheme(),
next_identity(),
object_id(),
object_name(),
pagesize(),
pointer_size(),
ptn_data_pgs(),
reserved_pgs(),
rowcnt(),
row_count(),
showplan_in_xml(),
syb_sendmsg(),
syb_sendmsg(),
System Functions,
tempdb_id(),
tran_dumpable_status(),
tsequal(),
used_pages(),
used_pgs().