PxPlus User Forum

Twitter Twitter Twitter

Author Topic: 'XK'  (Read 1094 times)

bbssupport

  • Silver Member
  • ***
  • Posts: 34
    • View Profile
'XK'
« on: August 12, 2020, 01:17:20 AM »
Hi PxPlusers!

I've been playing around with the XK parameter on a few of our data files but i'm not seeing much of a reduction in file size or increase in performance. Running the test programs from the users guide gives me the results described, so its just possible that the files i'm converting don't benefit much from the enhanced VLR format. I would like to do away with segmenting however, so I would like to convert all our files across to the newer format.

Can someone advise
1) is there a way to see (eg using FID/FIN etc) if a file is an enhanced VLR file (ie was created with the XK parameter turned on).
and
2) do i have to completely recreate each file with the XK parameter set, including the data dictionary, copy the data across, and then replace the original file with the new file? I read somewhere that you can issue a 'keyed load' to convert an enhanced VLR file back to a standard VLR so that it can be read by older PVX/PXPLUS versions.... does the same apply the other way?

Thanks :)

Mike King

  • Diamond Member
  • *****
  • Posts: 3810
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: 'XK'
« Reply #1 on: August 12, 2020, 09:33:06 AM »
In order to see any improvement with the XK parameter the key table need to be reloaded. As for what to expect in terms of improvement depends a lot on your file structure.

The major gain seen when file using XK is that the key blocks, the pages of the file used to maintain the keys, will be able to hold more than 255 keys.  For example if you have a file with a 8 character key, each key entry in the key block becomes 13 bytes long so the maximum amount of space in a key block used will be 13 * 255 = 3315 regardless of the block size.  So if you are using the default of a 4K block or about 20% of each block cannot be used.  Enabling XK allows the system to put more keys in a key block (~ 64,000) resulting in smaller file sizes and faster key access due to a shorter key tree.

Now if your keys are such that 255 keys will always fill a key block this will make little difference, however if your file has say a 16K page size, any key less than 60 bytes would result in wasted space.

Also, the XK parameter allows the system to create VLR files beyond 2GB -- so if you need larger files you may want this parameter enabled.
« Last Edit: August 12, 2020, 09:40:41 AM by Mike King »
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

bbssupport

  • Silver Member
  • ***
  • Posts: 34
    • View Profile
Re: 'XK'
« Reply #2 on: August 12, 2020, 05:43:57 PM »
Hi Mike,

Thanks for your reply. I makes sense that depending on the file and data structure, that results would vary.

Can I enable the XK parameter and issue a KEYED LOAD on each file to convert them to the enhanced VLR format, or do i need to recreate the file from scratch? Is there a way to detemine if a file is an enhanced VLR vs a standard VLR so that i can confirm the conversions have occurred?