Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE

Increasing performance of index file I-O using sharing modes

Increasing performance of index file I-O using sharing modes

Problem

Customer is running a large batch process that performs a lot of file I-O on indexed files and they would like to know if there is an option available that would help to speed up the performance when reading these files.

Resolution:

They might want to look at using sharing modes for their file processing.
Sharing modes inform the file handler how others will be accessing the files while the current process is accessing the files.

The default is that the file handler assumes that files open for input or i-o will be sharable by all other processes. This means that the file handler has to be constanly checking to ensure that the file has not been updated by someone else since the last time it was read and this can be time consuming.This is true even on a standalone single-user system where the file is not being shared.

By setting a sharing mode to allow no other then this will give you exclusive access to the file and the file handler will know that the file will not be changed by another process so it can speed processing time quite a bit. Likewise if you set the sharing mode to allow read only, then the file can be shared by others but cannot be updated.

These sharing modes can be set either in the select statement:

    select test-file assign to...
                           sharing with all other/no other

or on the open statement:

    open input sharing with all other/no other/read only test-file

In a recent test the following timings were returned while reading 8 million records sequentially from an indexed file.

sharing with all other   = 8 mins 40 secs
sharing with read only = 4 mins 23 secs
sharing with no other   = 2 mins 02 secs

 

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Top Contributors
Version history
Revision #:
1 of 1
Last update:
‎2013-04-19 08:48
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.