GDA: string lengths (was Re: GDA save missing records)

Graham Leggett minfrin at sharp.fm
Mon Feb 18 15:56:35 EST 2008


Phil Longstaff wrote:

> Well, as I originally said, I can use a TEXT type which allows up to 64K 
> byte strings.  Although not unlimited, I assume this is long enough for 
> everyone's purposes.  MySQL stores them as 2byte length + chars.  I will
> need to check that that libgda has some good method of creating them.  
> Of course, I could also just try varchar(2048) instead of varchar(50), 
> which should also be sufficient.  I assume that the db tries to optimize
> space so that storing a 1000 char string and storing a 1 char string in 
> a varchar(2048) don't use the same amount of space.

Generally, the database doesn't do this - it will allocate 2048 chars, 
whether you use 1 char or 1000. The upside of this is that it is very 
quick, the downside is that it wastes a lot of space.

Unlimited or "large" text strings are optimised, only because they have 
to be to be stored practically.

Regards,
Graham
--
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3287 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20080218/80aa6ff3/attachment.bin 


More information about the gnucash-devel mailing list