SQL/MX Connectivity Service Manual for SQL/MX Release 3.2 (H06.25+, J06.14+)
Design of MFC
MFC shares static module files created from dynamic queries using SQL/MX tools, across MXOSRVR
or SQL/MX connections.
MFC uses disk files on the NonStop Open System Services file system for storing the compiled
SQL/MX prepared statement plans. When the application uses prepareexecute or execdirect API,
MFC checks for an existing plan that matches the query. If a plan exists, it is loaded from the disk
thereby eliminating the requirement of SQL compilation of the query.
If a plan for an incoming PREPARE statement for a query is not found on the disk, a plan is created
as follows:
1. The incoming query is compiled as any other SQL/MX prepared statement.
2. After successful completion of the SQL/MX prepared statement, a plan is generated and stored
in the directory specified in the compiled_module_location attribute of SQL/MX.
Synchronization issues are handled using temporary lock files.
Use an MFC management script for maintaining the compiled module plans on the NonStop server.
The MFC management script is described under “Managing MFC” (page 50).
Configuring MFC from the MXCS mode
To configure the module file caching feature using the MXCS subsystem:
1. Enter the MXCS subsystem through MXCI:
mode mxcs;
2. Configure a data source for the user-specified MXOAS service:
add ds $MXOAS.”MCBS_datasource”;
NOTE: For instructions on adding a data source, see the SQL/MX Connectivity Service
Administrative Command Reference manual.
3. Stop the data source:
stop ds “MCBS_datasource”, reason ‘test’;
NOTE: Perform step 3 only if the configured data source is in the started state.
4. Add the statement_module_caching attribute to the data source to enable the module
file caching feature:
add evar $MXOAS.”MCBS_datasource”.statement_module_caching, type
set, value ‘true’;
This attribute has only two values, true and false. By default, this attribute is not enabled.
5. Add the compiled_module_location attribute to the data source:
add evar $MXOAS.”MCBS_datasource”.compiled_module_location, type
set, value ‘default’;
add evar $MXOAS.”MCBS_datasource”.compiled_module_location, type
set, value ‘/usr/MCBS_modules’;
If the ‘default’ value is specified then, compiled_module_location directory that is
set would be /usr/tandem/sqlmx/TEMPMODULES
The directory location specified in the compiled_module_location attribute will include
the following files:
a. The compiled module plans.
b. Temporary files such as *.lst,*.sql*.mdf ; all these files are retained in the directory to
enable easy troubleshooting.
Module File Caching (MFC) 49










