Default maximal length for VarChar Re: VChar vs VText

Ed Kleban Ed at Kleban.com
Thu Dec 8 09:42:47 CST 2005




On 12/8/05 9:27 AM, "Ruslan Zasukhin" <sunshine at public.kherson.ua> wrote:

> On 12/8/05 4:21 PM, "Ed Kleban" <Ed at Kleban.com> wrote:
> 
>>> For field with single byte encoding, you will be able use VarChar[2044].
>> 
>> Ok, let's do the math one more time.  I suspect the number 2044 may be
>> wrong.
>> 
>> We have a 4096 byte page less (8-byte page header) less (4 byte
>> string-length-header for each of 2 strings)
>>   = 4096 - 8 - (4 * 2)  = 4096 - 16
>>   = 4080 bytes for storage of actual string data,
>>   or 4080 / 2 = 2040 maximum storage bytes for each of two strings
>>   which in UTF-16 with two bytes per string
>>     = max 1020 characters per string.
>> 
>> Correct?  Or did I get it wrong?
> 
> Something wrong.
> 
> Aha, I think you use info from 1.x docs.
> 
> In v2 VarChar page do not have header at all.
> So 
> 
>     4096 - (4+4) = 4088.
> 
>     4088 / 2 = 2044.
> 
>     2044 / 2 = 1022.
> 

Grrrr.  This info came out of V2Kernel.pdf -- right after the part where it
tells me pages are 1024 bytes in length.  You need to get those docs updated
Ruslan.

Ok, thanks!
--Ed 




More information about the Valentina mailing list