valentina string field size questions

Bart Pietercil bart.pietercil at cognosis.be
Fri Sep 12 00:25:43 CDT 2008


Hi Joseph,

Let me try to explain (Ruslan will surely intervene if I get it wrong)

1) varchar stands for varying (in length) character field: ---> if you  
define a varchar (700) and only use 50 chars then only 50 chars are  
stored
So there is no string padding as would be in a string type of field
2) Textfields are a special kind of blob fields and as such capable of  
storing huge amounts (I forgot the theoretical limit, I think it is 4  
gigabyte). However these amounts are split over segments.
So when you are defining a text field you are asked for the optimal  
SEGMENT size. Let's say that you know most of your texts will be 4KB.  
Then it is optimal to define your segment size as 4096.
Whenever a text is inserted SMALLER then the segment size, you'll use  
4Kb of disksize (+ I think a small overhead for 'segment management')
If you insert a text BIGGER then the segment size you will use  
(size_of_inserted_text / segment_size) * segment_size + segment_size.

hth ( and is correct)

Bart Pietercil

On 12 Sep 2008, at 06:06, Joseph Morgan wrote:

>
>>
>> On Sep 9, 2008, at 8:08 AM, Ruslan Zasukhin wrote:
>>> So LAZY way is -- use TEXT
>>>
>>> More labor but can be more effective way -- use couple of VarChar
>>> and TEXT
>>> fields. TEXT field will be used only for strings longer of 2044.
>
> I was thinking about this. If a record is added and the field is left
> empty does it still take up the disk space?
>
> Please tell me if the following assumptions are correct:
>
> Example Record we will call it "TESTREC":
> field1 is a VarChar Field and has a length set to 400 but only has 50
> chars used <<< this takes up 400 chars worth of disk space
> field2 is a VarChar Field and has a length set to 700 and all 700
> chars are used <<< this takes up 700 chars worth of disk space
> field3 is a TEXT and uses 4000 chars <<< this takes up 4000 chars
> worth of disk space
>
> so "TESTREC" uses 5100 chars worth of disk space
>
> Is this correct?
>
>
> Thanks,
>
> Joseph
>
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina



More information about the Valentina mailing list