valentina string field size questions

Ruslan Zasukhin sunshine at public.kherson.ua
Fri Sep 12 01:15:50 CDT 2008


On 9/12/08 8:25 AM, "Bart Pietercil" <bart.pietercil at cognosis.be> wrote:

Hi Joseph,
Hi Bart,

> 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

Right, 50 + 4 bytes for THIS record.
    4 bytes store length
  
> So there is no string padding as would be in a string type of field

Yes.

And I can add that in the past Valentina did have Fixed Length String only
but not VarChar. It was surprise for me when VarChars was FASTER of String
field. Much faster. Because usually VarChar eat less disk space, and this
matter.


> 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.

Right.

I'd correct only.  
    TEXT field is 100% the same BLOB,
    just since it know it contains text, it can do indexing.
    BLOB filed cannot do indexing because do not know what data it have.

> 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.

100% right

> 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)

Yes 
 
> 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?

-- 
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