|
ptn_data_pgs()
The
system function
ptn_data_pgs()
returns the number of server
pages
in the specified
partition
of a
table.
The return value is not determined by searching the whole partition, but
with the help of the
object allocation map,
or short
OAM Page
of the table. The returned value can be incorrect under some cicumstances.
The exact value can be determined best after running one of the commands:
-
dbcc checkalloc
-
dbcc checkdb
-
update partition statistics
The system function "ptn_data_pages()" is replaced by the function
data_pages()
starting with ASE version 15.0. The function "ptn_data_pgs()" can be executed by any
user.
Syntax of the System Function ptn_data_pgs()
ptn_data_pgs(object_id, partition_id)
The parameter of the System Function ptn_data_pgs()
"object_id"
The parameter "object_id" describes the identification number of the table to be queried.
The "object_id" is stored in the column id
of the system table
sysobjects.
"partition_id"
The parameter "partition_id" is the identification number of the desired
Partition.
The "partition_id" can be retrieved from the column partitionid of the system table
syspartitions
erfragt werden.
Example for the System Function ptn_data_pgs()
select ptn_data_pgs(object_id("salesdetail"), 1)
-----------
5
Returns the number of server pages (5) allocated for the partition with id 1 in the table
"salesdetail".
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(), 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().
|