Why Migrate from Btrieve to PostgreSQL and other Relational Databases?
Introduction Many independent software vendors (ISV) and corporate users still rely on applications that use a category of database collective called...
Mertech’s Lazy Open mode feature is designed to improve an application's initialization performance by deferring table setup. Lazy Open mode delays the setup of table metadata (table, columns, indexes description) in memory until a field is accessed, even if an OPEN command is issued.
Lazy Open mode is particularly useful for applications that open a large number of files when the program is launched. For example, if a program opens 30 files but only 10 are accessed immediately, then the metadata for only those 10 tables is fetched from the server at application initialization. The remaining tables are not opened until an action outside of open is performed on them.
Lazy Open mode is disabled by default. Lazy Open mode can be enabled by either calling a new macro command or through the Mertech.INI file.
Enabling Lazy Open Mode
Lazy Open mode can be enabled in two ways: a) by calling a macro command or b) by setting a flag in the Mertech.INI file. Set Lazy Open mode in the .INI file only if you want to globally enable it for the entire run of the program. Mertech recommends that you evaluate performance for file opens before deciding on which approach is suitable for your application. It is important to note that Lazy Open mode is a global setting and once set remains in effect until the open mode setting is restored to its default value.
Using the Macro Command
Lazy Open mode can be enabled by calling the macro command SET_OPEN_MODE. The syntax for this macro is:
SET_OPEN_MODE TO DEFAULT|LAZY_MODE
where
DEFAULT means to use the regular open mode
LAZY_MODE means to use the new Lazy Open mode
For example, the following code enables Lazy Open mode:
SET_OPEN_MODE TO LAZY_MODE
Open "customer.int" as customer
::
::
FIND GT customer By Index.1
::
During OPEN command execution, the database driver opens the .INT file to retrieve the basic table information(table name, owner, database, number of columns). The database request for the table metadata is delayed until an operation other than OPEN (such as a find, clear, update, delete etc) is performed.
Since Lazy Open mode is a global setting, every table is opened using the new Lazy Open mode after a SET_OPEN_MODE TO LAZY_MODE command is issued. Return to default open mode behavior by calling SET_OPEN_MODE TO DEFAULT.
Using the Mertech.INI file
Lazy Open mode can also be enabled by adding the following line to the Mertech.INI file.
LazyOpenMode yes
These Mertech.INI entries enable Lazy Open mode for SQLFlex and PgFlex drivers:
[MSSQL]
LazyOpenMode yes
[PGSQL]
LazyOpenMode yes
Introduction Many independent software vendors (ISV) and corporate users still rely on applications that use a category of database collective called...
COBOL applications are the foundation of numerous essential business functions, especially within the banking, insurance, and government sectors....
Imagine breaking free from the constraints of old, monolithic systems and embracing the agility and innovation of cloud-based solutions.