Database Operation Counts (API Guide)

From InterBase

Go Up to Request Buffer Items and Result Buffer Values (API Guide)


Several information items are provided for determining the number of various database operations performed by the currently attached calling program. These values are calculated on a per-table basis.

When any of these information items is requested, InterBase returns to the result buffer:

  • 1 byte specifying the item type (for example, isc_info_insert_count).
  • 2 bytes telling how many bytes compose the subsequent value pairs.
  • A pair of values for each table in the database on which the requested type of operation has occurred since the database was last attached.

Each pair consists of:

  • 2 bytes specifying the table ID.
  • 4 bytes listing the number of operations (for example, inserts) done on that table.
Tip:
To determine an actual table name from a table ID, query the system table, ­RDB$RELATION.

The following table describes the items which return count values for operations on the database:

Database Information Items for Operation Counts
Request buffer item Result buffer contents

backout_count

Number of removals of a version of a record

delete_count

Number of database deletes since the database was last attached.

expunge_count

Number of removals of a record and all of its ancestors, for records whose deletions have been committed.

insert_count

Number of inserts into the database since the database was last attached.

purge_count

Number of removals of old versions of fully mature records (records that are committed, so that older ancestor versions are no longer needed).

read_idx_count

Number of reads done via an index since the database was last attached.

read_seq_count

Number of sequential table scans (row reads) done on each table since the database was last attached.

update_count

Number of database updates since the database was last attached.

Advance To: