----- Original Message -----
From: "Simon Lewington" <[EMAIL PROTECTED]>

Sent: Friday, February 13, 2004 7:41 AM
Subject: [UD] File block size with long keys


> UD 6.0.7 on Windows
>
> Does anyone know if Unidata is doing something special writing data with
> long keys to a static file - and what that is?
>
> Running the following...
>
> KEYLENGTH=36
> DTALENGTH=0
> MODULO=1
> SEP=1
> NRECORDS=3
> EXECUTE 'CLEAR-FILE DATA SRLTEMP1'
> PCPERFORM 'memresize SRLTEMP1 ':MODULO:',':SEP:' TYPE 0 STATIC'
> OPEN "SRLTEMP1" TO SRLTEMP1 ELSE STOP
> FOR N=1 TO NRECORDS
>   WRITE STR('0',DTALENGTH) ON SRLTEMP1,OCONV(N,'MR%':KEYLENGTH)
> NEXT N
> PCPERFORM 'guide SRLTEMP1 -o'
>
> ...shows that the block is overflowed, even though it's only got 3 records
> of less that 50 bytes each.
>
> 36 bytes looks like it's the cutoff on key length - below that the
overflow
> vanishes.  Above that and any block with more than one item overflows.
With
> a block size of 2048, 86 bytes is the cutoff.  Using a non-zero data
length
> makes no difference (ie 35 byte keys won't overflow even with 50 byte
data).
>
> I can't find anything in the manual saying what's going on, or
recommending
> different block sizes for files with long keys.
>
> Cheers
> Simon
>

Simon,

Well, it looks like nobody else is going to answer this one.  Just from
observation, using Unidata PE on Windows and a hex editor, it appears that
even 2 records with keys 36 bytes long in a static file with blocksize 1024
will cause the key-and-displacement table to take the entire block, with the
data being put into overflow.  On the other hand, with a blocksize 2048, I
put 10 records with 36-byte keys into a block without going into overflow.
I don't know what the algorithm is for determining when the group is forced
into overflow, but my gut feeling is, for longer keys, I would increase the
blocksize.

This was of interest to me because we have a few files, which, depending on
the size of the component data elements in the keys (codes which are defined
by our users), could easily reach your 36-byte size, so I took a quick look.
Another thing to be wary of when sizing files - sigh!

Susan M. Lynch
F.W. Davison & Company, Inc.



-- 
u2-users mailing list
[EMAIL PROTECTED]
http://www.oliver.com/mailman/listinfo/u2-users

Reply via email to