Addtional information on TMP$HEAPS and TMP$TRIGGERS tables

By: Quinn Wildman

Abstract: InterBase 7.5 introduces the 2 new system temporary tables, TMP$HEAPS and TMP$TRIGGERS.

TMP$HEAPS and TMP$TRIGGERS are documented as all other system tables are in the Language Reference manual. Below is additional discussion on these new tables written by the architect of these new tables.

TMP$HEAPS lists the InterBase server's two types of memory heaps, RANDOM_HEAP and BLOCK_HEAP which both use a new first-fit allocation method. The RANDOM_HEAP allocates many small, random-sized requests while the BLOCK_HEAP always allocates in block multiples of 1,024 bytes with no fragmentation. Both heaps can be searched in parallel in IB7.5 as they have separate synchronization mutexes. Prior to InterBase 7.5 there was only one heap which was used for everything.

TMP$HEAPS should really help all of us visualize what memory allocations look like and what the cost of those allocation might be. It should also help demonstrate how the server can self-regulate its memory consumption needs as it dynamically releases unnecessary procedure and trigger clones.

SQL> select * from tmp$heaps;
 
TMP$TYPE                        RANDOM_HEAP
TMP$HEX_ADDRESS         0X0000000000AE004C
TMP$ADDRESS                 11403340
TMP$FREE_MEMORY        101844
 
TMP$TYPE                        RANDOM_HEAP
TMP$HEX_ADDRESS         0X0000000000AF9BB4
TMP$ADDRESS                 11508660
TMP$FREE_MEMORY        200
 
TMP$TYPE                        RANDOM_HEAP
TMP$HEX_ADDRESS         0X0000000000AFAD3C
TMP$ADDRESS                 11513148
TMP$FREE_MEMORY        16
 
TMP$TYPE                        RANDOM_HEAP
TMP$HEX_ADDRESS         0X0000000000B00008
TMP$ADDRESS                 11534344
TMP$FREE_MEMORY        32
 
TMP$TYPE                        BLOCK_HEAP
TMP$HEX_ADDRESS         0X0000000001D3000C
TMP$ADDRESS                 30605324
TMP$FREE_MEMORY        55008
 
TMP$TYPE                        BLOCK_HEAP
TMP$HEX_ADDRESS         0X0000000001D3F308
TMP$ADDRESS                 30667528
TMP$FREE_MEMORY       1028
 
TMP$TYPE                        BLOCK_HEAP
TMP$HEX_ADDRESS         0X0000000001D41324
TMP$ADDRESS                 30675748
TMP$FREE_MEMORY        17472
 
TMP$TYPE                        BLOCK_HEAP
TMP$HEX_ADDRESS         0X0000000001D45F6C
TMP$ADDRESS                 30695276
TMP$FREE_MEMORY       1028
 
TMP$TYPE                        BLOCK_HEAP
TMP$HEX_ADDRESS         0X0000000001D47B88
TMP$ADDRESS                 30702472
TMP$FREE_MEMORY        5140
 
TMP$TYPE                        BLOCK_HEAP
TMP$HEX_ADDRESS         0X0000000001D493A0
TMP$ADDRESS                 30708640
TMP$FREE_MEMORY       1028
 

SQL>
TMP$TRIGGERS is the missing cousin of TMP$PROCEDURES and will help to further understand what the cost in execution and memory might be on a busy system.
 
SQL> select * from tmp$triggers;
 
TMP$TRIGGER_ID                  1
TMP$TRIGGER_NAME            RDB$TRIGGER_18
 
TMP$DATABASE_ID                2
TMP$RELATION_NAME           RDB$INDEX_SEGMENTS
 
TMP$TYPE                              3
TMP$SEQUENCE                    0
TMP$ORDER                          BEFORE
TMP$OPERATION                   UPDATE
TMP$POOL_ID                        34
TMP$POOL_MEMORY            2048
TMP$CLONE                           0
TMP$TIMESTAMP                   1970-01-01 00:00:00.0000
TMP$QUANTUM                      0
TMP$INVOCATIONS                0
TMP$PAGE_READS                0
TMP$PAGE_WRITES               0
TMP$PAGE_FETCHES             0
TMP$PAGE_MARKS                0
TMP$RECORD_SELECTS         0
TMP$RECORD_INSERTS          0
TMP$RECORD_UPDATES        0
TMP$RECORD_DELETES         0
TMP$RECORD_PURGES          0
TMP$RECORD_EXPUNGES      0
TMP$RECORD_BACKOUTS      0

Server Response from: ETNASC04