Main Menu

KB#00052-Dynamic mkeyed file grows disproportionately large

Title:

Dynamic mkeyed file grows disproportionately large

Description:

If there is a large amount of data entry going into an mkeyed file on a daily basis that involves entering sequential primary keys, BBx still allocates space between the keys to allow for growth in the file. For example: 

The primary keys are something like: "0000001", "0000002", "0000003", etc. The interpreter writes a block to the file for the keys 0000001 and 0000002 and then leaves some "white space", then writes the blocks for 00000003 and 0000004, etc. It is leaving this "white space" to allow for additions to the file at a later time. 

If the primary keys are written in sequential order there won't be any insertions between the primary key numbers, but the interpreter doesn't know that so you end up with a file that is out of proportion and growing by astronomical leaps and bounds. There's no getting around this, other than to compact the file every now and then by writing all the records to a STRING file and then writing them to a new copy of the MKEYED file in a somewhat random fashion. 

For a sample program to eliminate this problem see KB00887. 



Last Modified: 02/10/2004 Product: PRO/5 Operating System: All platforms

BASIS structures five components of their technology into the BBx Generations.

  Google+ View BASIS LinkedIN ProfileVisit our Twitter Feed Check out our Facebook Public Profile Click to View the BASIS youTube channel