sp_iqdbsize Procedure

Displays the size of the current database.

Syntax

sp_iqdbsize([ main ] )

Applies to

Simplex and multiplex.

Privileges

Requires the ALTER DATABASE system privilege. Users without the ALTER DATABASE system privilege 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).

If run on a multiplex database, the default parameter is main, which returns the size of the shared IQ store.

If run when there are no rows in any RLV-enabled tables, the Physical Blocks, the RLVLogBlocks and RLVLogKBytes columns will contain non-zero entries, and the remaining columns contain zeros. This indicate no row-level versioned tables.

Column Name

Description

Database

The path name of the database file.

Physical Blocks

Total database size in 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 SAP Sybase IQ dbspace size, represented in blocks.

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 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 metadata for these objects. This value is always less than or equal to the value of Pages (the previous sp_iqdbsize column), because SAP 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. 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.

RLVLogBlocks

Number of blocks used for log information for the RLV store.

RLVLogKBytes

Total size of the RLV log, in Kb.

Example

Displays size information for the database iqdemo:

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