by Stephen Persson >> Wed, 15 Nov 2000 22:47:00 GMT
Hi,
I just had a thought as to why I bother to set the length when creating a string attribute, rather than setting it to maximum length. (Except if the field is to be a dictionary key in which case I realise it can't be maximum length).
Heres how I understand it works:
Say I create a field for a Street Address. If a length is specified (say 60) then 60 bytes of space is reserved for this field regardless of its actual value. Even if the address is only 10 bytes, 60 bytes of space is taken up for this field.
As I understand it though, if I set the length to maximum, Jade does not reserve any space for the field, and the storage space used, is only ever exactly what is required for each particular instance.
So why do we even bother to set the length on string fields that aren't a dictionary key?
It seems to me to be a waste of space (sure disk space is cheap, but thats not really the point!), and you have to also then make sure the user can't/doesn't enter to much data.
I'm assuming therefore there must be performance issues related to setting string field to maximum length - true?
Stephen Persson
Kinetix Group Ltd