Table cache
Scope/Lifetime |
Live in the profile (and not in other profiles) during the profile run/test. |
Table Caches are an extended form of maps that can hold references to other Table Caches. They are used to replace database tables that are very often used and therefore can have a massive impact on the performance of a mapping. Since Table Caches are kept in memory, access times are significantly lower than a database request via a network. A table cache is structured similarly to a table.
It has a name.
It contains columns, each with a name where convention defines that the first column is also the primary key identifying an entry. This is similar to the key of a normal map.
Values of columns can be references to entries of another Table Cache (foreign keys).
A table cache is created using the create table cache() function. The function defines the name of the Table Cache and the names of its columns. As already mentioned, the first column is also the column containing the primary key. Foreign keys are declared using the syntax "foreign_cache_name>column_name".
Entries can be added to the cache with function add to table cache(). You can read from the cache with get value from table cache() and create a dump with dump table cache() . The content of a cache can be deleted with clear table cache().
Note: Instead of Table Caches, memory based databases can be used as well (e.g. HSQL, McKoi, MySQL tables with the storage engine MEMORY).