Default maximal length for VarChar Re: VChar vs VText

Ruslan Zasukhin sunshine at public.kherson.ua
Mon Nov 28 13:59:57 CST 2005


On 11/28/05 3:57 AM, "Ed Kleban" <Ed at Kleban.com> wrote:

>> Actually in v2 for UTF8 the best size of VarChar will be 2044.
>> 
> 
> Why?  Does this have to do with the natural page size of MacOS X or
> something?  

Yes. Best size of page is 4K

We assume that page should keep at least 2 records.

So max size *in bytes* for one record is (4K - header) / 2 = 2044

 
> I understood the logic described in the Kernel manual which makes good
> sense:
> 
> " The default maximal length for VarChar field is 504 bytes. This is the
> maximum number that allows us to work with 1,024 byte pages. Indeed:
>  8 bytes of header + 2 records *  (504 + 4) = 1024 bytes.
> You can specify lower values for maximal length (e.g., 20), but 1,024 byte
> pages will still be used. The only advantage is that you will truncate
> longer strings to 20 bytes.
> "

Ops, this is old logic !!!

It count that page size is 1K. Now it is 4K.


> Is this no longer true?  Has the change to unicode in V2 made it the case
> that the default maximal length has changed?   Is the Kernel manual
> incorrect?
> 
> If the minimal page size is still 1024 bytes, then wouldn't that mean since
> each character now takes up 2 bytes in UTF-16 when stored, instead of one by
> as when previously stored in UTF-8, that the default maximal length for a
> VarChar field should now be 504 / 2 = 252 bytes?
> 
> I don't have enough detail yet for this to make sense.

-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina mailing list