|
pagesize()
The
system function
pagesize()
returns the size of
server pages
of the
object
specified in the function parameters.
The return value is always equivalent to the value stored in the
global variable
@@maxpagesize.
Exceptions exist for objects which do not make use of physical storage, like for example
views.
If the function is used with such objects, the return value is "0".
If the object does not exist, the return value is "NULL".
If the function is executed without the paramter "index_id", or
"index_name", as default, the function accesses the data segments of the object.
The same is valid if one of these parameters has been specified as "NULL".
Syntax of the System Function pagesize()
pagesize(table_name [,index_name]|table_id [,db_id [,index_id]])
The parameters of the System Function pagesize()
"table_name"
Describes the name of the
table
to be queried.
The name of a table is stored in the
column
"name" of the
system table
sysobjects.
"index_name"
Is the name of the
Index
to be queried.
Index names can be found in the column "name"
of the system table
sysindexes.
"table_id"
The "table_id" is the identification number of the table for which the
pagesize shall be determined.
The "table_id" is stored in the column "id"
of the system table sysobjects.
"db_id"
The parameter "db_id" is the identification number of the
database,
in which the object is stored. The "db_id" can be retrieved from the column
"dbid" of the system table
sysdatabases.
"index_id"
The parameter "index_id" describes the identification number
of the index to be queried.
The value of the id is stored in the column "id" of the system table
sysindexes.
Example for the System Function pagesize()
1> select pagesize("titles", "idx_u_titles_1")
2> go
-----------
2048
Returns the page size of the index "idx_u_titles_1" on the table "titles".
1> select pagesize("titles", "NotHere")
2> go
-----------
NULL
Returns NULL, because the index called "NotHere" does not exist.
1> select pagesize(object_id("titles"),NULL, 2)
2> go
-----------
2048
Returns the page size of the
non-clustered Index
on the table called "titles" in the current database ("NULL").
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(), pointer_size(), ptn_data_pgs(), reserved_pages(), reserved_pgs(), rowcnt(), row_count(), showplan_in_xml(), syb_sendmsg(), syb_sendmsg(), System Functions, tempdb_id(), tran_dumpable_status(), tsequal(), used_pages(), used_pgs().
|