Saving Master Files in Memory for Reuse

How to:

Reference:

You can save up to 99 Master Files in memory after they have been used in a request. The saved Master Files are not re-parsed when referenced in subsequent requests, resulting in a significant performance improvement. The greatest improvement occurs in Master Files with a great many fields, where parsing is slowest.

Saving Master Files in memory is particularly helpful when running multiple requests against several Master Files. The most recently used Master File is stored in memory regardless of this setting. With each request that specifies a new Master File, the prior Master File is moved down on the saved list and the new Master File is placed at the top of the list. Once all of the slots on the list are full, parsing a new Master File causes the one at the bottom to drop off the list. If an already saved Master File is used in a request, it moves to the top of the list.

Only one occurrence of a Master File name is maintained on the list. Therefore, if you use an already saved Master File as the host file in a JOIN, in a HOLD command (with the same AS name), in a USE...AS command, or in a COMBINE command without specifying a unique name, the new version of the Master File replaces the previous version on the list. A JOIN CLEAR or USE CLEAR command purges the parsed Master File from memory.

If a Master File will be re-parsed multiple times, you can save the I/O needed to retrieve it from disk by loading it into memory using the LOAD command described in Loading a File.

Note: SAVEDMASTERS is not an effective technique to use with massive amounts of data because the amount of time saved by not re-parsing is small in comparison to the time for processing the data.

Syntax: How to Save Parsed Master Files in Memory

SET SAVEDMASTERS = n

where:

n

Is an integer between 0 and 99 that specifies the maximum number of Master Files on the SAVEDMASTERS list. The default value is 0. Note that the most recently used Master File is always stored in memory, even with SAVEDMASTERS set to zero. However, the zero setting does not generate the list of saved Master Files.

Syntax: How to Query the SAVEDMASTERS Setting

The following query command indicates the number of Master Files allowed on the list of saved Master Files and lists the names of the Master Files on the list.

? SET SAVEDMASTERS

Example: Saving and Querying Parsed Master Files

The following command specifies that up to three parsed Master Files can be saved:

SET SAVEDMASTERS = 3

Issue the Query command:

? SET SAVEDMASTERS

The output of the query command indicates that the list can contain up to three Master Files, but none are currently saved:

SAVEDMASTERS               3

The following procedure parses two Master Files, EMPLOYEE and MOVIES:

TABLE FILE EMPLOYEE
PRINT LAST_NAME FIRST_NAME BY EMP_ID
END
-RUN
TABLE FILE MOVIES
PRINT TITLE BY DIRECTOR
END
-RUN
? SET SAVEDMASTERS

In this example, the output of the query command indicates that the list can contain up to three Master Files and that the list currently consists of MOVIES and EMPLOYEE:

SAVEDMASTERS               3
 
  MOVIES
  EMPLOYEE

Reference: Usage Notes for SET SAVEDMASTERS

  • Memory resources are used to store the parsed Master Files, reducing the amount of memory available for other processes.
  • You cannot selectively purge Master Files from the list.
  • The SAVEDMASTERS parameter is not supported in a request (ON TABLE SET) or in FOCPARM.
  • The SAVEDMASTERS setting is not supported on a FOCUS Database Server or with a Maintain procedure.
  • The SAVEDMASTERS setting is not supported with SCAN or FSCAN.
  • Issuing the CHECK FILE or REBUILD command causes the specified Master File to be re-parsed.
  • The ?F and ?FF commands only re-parse the Master File when issued outside of a request for a Master File other than the most recently used Master File.
  • Using an alternate file view (TABLE FILE filename.fieldname) or the AUTOPATH=ON setting re-parses the Master File.
  • If the SAVEDMASTERS value is changed between requests:
    • Raising the number allows more Master Files to be saved as they are parsed.
    • Lowering the number drops the oldest saved Master Files.
  • If changes are made to a Master File that is saved, the changes will not be implemented until the Master File is re-parsed.
  • When only one Master File has been used, it is not placed on the SAVEDMASTERS list.
  • DEFINE expressions are not stored and, therefore, are re-parsed every time they are used.
  • Creating a HOLD file erases the Master File name from the list if it is there, and the HOLD command does not place the new Master File on the list.
  • SAVEDMASTERS is most effective when a Master File has a lot of fields.
  • The FML Hierarchy LOAD CHART command does not add the Master File to the SAVEDMASTERS list.

Information Builders