sp_iqdbsize procedure

Function

Displays the size of the current database.

Syntax

sp_iqdbsize([ main ] )

Permissions

DBA authority required. Users without DBA authority must be granted EXECUTE permission to run the stored procedure.

Description

Returns the total size of the database. Also returns the number of pages required to hold the database in memory and the number of IQ pages when the database is compressed (on disk).

Table 7-17: sp_iqdbsize columns

Column name

Description

Database

The path name of the database file.

Physical Blocks

Total database size in blocks.

KBytes

Total database size in kilobytes.

Pages

Total number of IQ pages.

Compressed Pages

Total number of IQ pages that are compressed (on disk). Subset of Pages.

NBlocks

Total size, in IQ blocks, used to store the data in tables and join indexes.

Catalog Blocks

Total size, in IQ blocks, used to store the metadata for tables and join indexes. Subset of NBlocks.

Descriptions of sp_iqdbsize columns:

Database The path name of the current database file.

Physical Blocks An IQ database consists of one or more dbspaces. Each dbspace has a fixed size, which is originally specified in units of megabytes. This megabyte quantity is converted to blocks using the IQ page size and the corresponding block size for that IQ page size. The Physical Blocks column reflects the cumulative total of each Sybase IQ dbspace size, represented in blocks.

For the correspondence between IQ page size and block size, see Chapter 4, “Managing System Resources” in the Performance and Tuning Guide.

KBytes The total size of the database in kilobytes. This value is the total size of the database in blocks (Physical Blocks in the previous sp_iqdbsize column) multiplied by the block size. The block size depends on the IQ page size.

Pages The total number of IQ pages necessary to represent in memory all of the data stored in tables and join indexes, as well as the metadata for these objects. This value is always greater than or equal to the value of Compressed Pages (the next sp_iqdbsize column).

Compressed Pages The total number of IQ pages necessary to store on disk the data in tables and join indexes as well as the metadata for these objects. This value is always less than or equal to the value of Pages (the previous sp_iqdbsize column), because Sybase IQ compresses pages when the IQ page is written from memory to disk. The sp_iqdbsize Compressed Pages column represents the number of compressed pages.

NBlocks The total size in blocks used to store the data in tables and join indexes. This value is always less than or equal to the sp_iqdbsize Physical Blocks value.

Catalog Blocks The total size in blocks used to store the metadata for tables and join indexes.

Example

Displays size information for the database iqdemo:

sp_iqdbsize 
Database                                                                                             
PhysicalBlocks KBytes Pages CompressedPages NBlocks CatalogBlocks
============== ====== ===== =============== ======= =============
/system1/sybase/IQ-15_2/demo/iqdemo.db
          1280    522   688            257    1119             18

See also

“Specifying page size” in “Overview of memory use” in Chapter 4, “Managing System Resources” in the Performance and Tuning Guide

“Working with database objects” in Chapter 5, “Working with Database Objects” in the System Administration Guide: Volume 1

“sp_iqdbsize procedure” in Appendix A, “Multiplex Reference,” in Using Sybase IQ Multiplex.