precisions on set, bitset and arrayset

Ruslan Zasukhin sunshine at public.kherson.ua
Fri Jan 14 20:44:07 CST 2005


On 1/14/05 7:09 PM, "Olivier" <vidal_olivier at yahoo.fr> wrote:

> Hi,
> 
> What is that an arrayset ?
> What is the difference between a set and a bitset ?

ArraySet -- array of integers.
BitSet -- set of bits.

You use this to get/keep SELECTION OF records.


ArraySet is good for small selections.
BitSet is godo for big selections.

** Let you have million records table.
And Find() returns 100 records.
    
    BitSet always million bits. = 128 KB
    AraySet 100 * 4 = 400 bytes

** Now let Find() return 300,000 records.

    BitSet always million bits. = 128 KB
    AraySet 300,000 * 4 = 1.2 MB

For all records

    BitSet always million bits. = 128 KB
    AraySet 1M * 4 = 4 MB


Also note, that SORT() always return ArraySet,
Because bitset cannot keep sort order.

> A set is thus a record selection. A sort of temporary table ?

:-) 

Not exactly. 

You have ONE table. You can have many selections for it.
You can have many threads that will use that selections.

Selection this is RAM only array that keep RecID of records.
BitSet also indirectly keep RecIDs.


> Does It take a lot of memory ?

This is minimal we can do.

Cursor for example use BitSets and ArraySets also.
Just you did not know about thus before. :-)


-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------




More information about the Valentina-beta mailing list