application , business , compliances , security

Sample – Useful Interbase queries

September 5, 2012

Interbase is a high performance, multiplatform and scalable relational database. Below are some common queries you can use.

SELECT TMP$ATTACHMENTS FROM TMP$DATABASE

Number of active connections (SMALLINT) 

SELECT TMP$STATEMENTS FROM TMP$DATABASE

Number of compiled statements (INTEGER) 

SELECT TMP$ALLOCATED_PAGES FROM TMP$DATABASE

Pages allocated to all database files (INTEGER) 

SELECT TMP$POOLS FROM TMP$DATABASE

Number of memory pools (INTEGER) 

SELECT TMP$PROCEDURES FROM TMP$DATABASE

Number of procedures loaded (SMALLINT) 

SELECT TMP$RELATIONS FROM TMP$DATABASE

Number of relations loaded (SMALLINT) 

SELECT TMP$TRIGGERS FROM TMP$DATABASE

Number of triggers loaded (SMALLINT) 

SELECT TMP$ACTIVE_THREADS FROM TMP$DATABASE

Active threads in database (SMALLINT) 

SELECT TMP$SORT_MEMORY FROM TMP$DATABASE

Sort buffer allocated memory (INTEGER) 

SELECT TMP$CURRENT_MEMORY FROM TMP$DATABASE

Current memory allocated database (INTEGER) 

SELECT TMP$MAXIMUM_MEMORY FROM TMP$DATABASE

Maximum memory ever allocated (INTEGER) 

SELECT TMP$PERMANENT_POOL_MEMORY FROM TMP$DATABASE

Permanent pool memory size (INTEGER) 

SELECT TMP$CACHE_POOL_MEMORY FROM TMP$DATABASE

Buffer pool memory size (INTEGER) 

SELECT TMP$TRANSACTIONS FROM TMP$DATABASE

Number of active transactions (SMALLINT) 

SELECT TMP$TRANSACTION_COMMITS FROM TMP$DATABASE

Number of transaction commits (INTEGER) 

SELECT TMP$TRANSACTION_ROLLBACKS FROM TMP$DATABASE

Number of transaction rollbacks (INTEGER) 

SELECT TMP$TRANSACTION_PREPARES FROM TMP$DATABASE

Number of transaction prepares (INTEGER) 

SELECT TMP$TRANSACTION_DEADLOCKS FROM TMP$DATABASE

Number of transaction deadlocks (INTEGER) 

SELECT TMP$TRANSACTION_CONFLICTS FROM TMP$DATABASE

Number of transaction update conflicts (INTEGER) 

SELECT TMP$TRANSACTION_WAITS FROM TMP$DATABASE

Number of transaction wait for (INTEGER) 

SELECT TMP$CACHE_BUFFERS FROM TMP$DATABASE

Number of cache buffers (INTEGER) 

SELECT TMP$CACHE_PRECEDENCE FROM TMP$DATABASE

Nodes in cache precedence graph (INTEGER) 

SELECT TMP$CACHE_LATCH_WAITS FROM TMP$DATABASE

Buffer latch waits (INTEGER) 

SELECT TMP$CACHE_FREE_WAITS FROM TMP$DATABASE

Number of waits for a free buffer (INTEGER) 

SELECT TMP$CACHE_FREE_WRITES FROM TMP$DATABASE

Number of writes to free buffers (INTEGER) 

SELECT TMP$SWEEP_INTERVAL FROM TMP$DATABASE

Sweep trigger interval (INTEGER) 

SELECT TMP$SWEEP_ACTIVE FROM TMP$DATABASE

‘Y’ (active) or ‘N’ (not-active) (CHAR[1]) 

SELECT TMP$SWEEP_RELATION FROM TMP$DATABASE

Relation currently being swept (CHAR[67]) 

SELECT TMP$SWEEP_RECORDS FROM TMP$DATABASE

Records swept in above relation (INTEGER) 

SELECT TMP$PAGE_READS FROM TMP$DATABASE

Page reads all database files (INTEGER) 

SELECT TMP$PAGE_WRITES FROM TMP$DATABASE

Page writes all database files (INTEGER) 

SELECT TMP$PAGE_FETCHES FROM TMP$DATABASE

Page fetches all database files (INTEGER) 

SELECT TMP$PAGE_MARKS FROM TMP$DATABASE

Page marks all database files (INTEGER) 

SELECT TMP$RECORD_SELECTS FROM TMP$DATABASE

Records selected from database (INTEGER) 

SELECT TMP$RECORD_INSERTS FROM TMP$DATABASE

Records inserted into database (INTEGER) 

SELECT TMP$RECORD_UPDATES FROM TMP$DATABASE

Records updated to database (INTEGER) 

SELECT TMP$RECORD_DELETES FROM TMP$DATABASE

Records deleted from database (INTEGER) 

SELECT TMP$RECORD_PURGES FROM TMP$DATABASE

Garbage collect record purges (INTEGER) 

SELECT TMP$RECORD_EXPUNGES FROM TMP$DATABASE

Garbage collect record expunges (INTEGER) 

SELECT TMP$RECORD_BACKOUTS FROM TMP$DATABASE

Garbage collect record backouts (INTEGER)