By default, the entire database file is loaded into memory. With the lazy loading feature, the database will
load table columns on demand when they are needed. If a column is never used in a query, then less
memory is used since that column never needs to be loaded.
The potential small trade off is in performance as a column will need to be loaded before it can be used in a query. Also, the lazy load feature will use additional disk space in the InMemory data directory as temporary copies of the targitdb data files need to be created. The temporary copy is needed to avoid the original file being locked and can therefore still be updated. Lazy load is supported from TARGIT 2021 version of TARGIT InMemory and requires that the database is created using tiImport from that version or later.
To use lazy loading in the tiServer process, LazyLoad=true needs to be added to the targitdb.ini file and the tiServer restarted. In the default mode when using lazy loading, columns will stay loaded after first use. However, columns can be configured to unload after a period of not being used. This period is specified in the lazyload_unload_column_timer option in targitdb.ini. The unload time is specified in minutes, e.g.lazyload_unload_column_timer=15.
TARGIT Query Tool can also open a database in lazy load mode.
To use the lazy loading feature in ETL scripts, add the lazyload keyword when declaring a datasource. e.g.
DATASOURCE A1 = LAZYLOAD local inmemorydb ‘c:\targit datadir\mydatabase.targitdb’