View previous topic :: View next topic
|
Author |
Message |
monasu1998
Active User
Joined: 23 Dec 2005 Posts: 176 Location: India
|
|
|
|
Hi,
Can someone please let me know the adventage of fixed format compression?
In the SAG manual it is written like
Fields defined as fixed format (FI) do not include a length byte and are not compressed. This option actually saves storage space for one-byte fields or fields that are nearly always full (e.g., a field containing the social security number).
Does it mean that, for the fileds 'one-byte fields or fields that are nearly always full' it is saving 1byte of space by not including the length byte?
Thanks, |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Does it mean that, for the fileds 'one-byte fields or fields that are nearly always full' it is saving 1byte of space by not including the length byte |
Yes. If a field is defined as one byte, there is no reason to use another byte to define the length. It is completely wasted.
Similarly, if there is a Code that must always contain exactly 7 bytes, there is no reason to provide space for the length. |
|
Back to top |
|
|
monasu1998
Active User
Joined: 23 Dec 2005 Posts: 176 Location: India
|
|
|
|
Thank you d.Sch for clarifying my doubt. :-) |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
You're welcome
d |
|
Back to top |
|
|
Ralph Zbrog
New User
Joined: 21 Nov 2009 Posts: 58 Location: California
|
|
|
|
dick scherrer wrote: |
If a field is defined as one byte, there is no reason to use another byte to define the length. It is completely wasted. |
Completely wasted? Not entirely true. You won't define every one-byte field as Fixed just to avoid wasting the length byte.
Let's say that you have a field defined as A1, always containing either "Y" or "N", and used in a superdescriptor. A READ by this superdescriptor would return all records, both Y and N.
But what if you stored only "Y" or " " in the field? By defining the field as Null-suppressed instead of Fixed, a READ by the superdescriptor would return only records containing "Y". This technique can drastically reduce the number of records processed and improve performance - well worth the "wasted" length byte.
You can reduce the waste of compressed fields by defining them as contiguous null-suppressed fields in the Adabas record. Multiple null-valued, null-suppressed fields will occupy a single byte in the compressed record. This is why, when you look at a DDM, most fields are defined with N in the suppression column. Most DBAs specify N as the default. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
I'll stay with my original answer (true for many database systems, not necessarily Adabas/Natural). Having the length for a one-byte or "always full" field is a complete waste. . .
Not that this is all bad. Tuning issues often cause exceptions (waste) to "waste free" implementation. Most commonly in my experience is to de-normalize certain data in end-user, query-only databases.
To single out the extremely rare 'Y' or ' ' versus 'Y' or 'N' goes way beyond a "helpful hint". . . |
|
Back to top |
|
|
|