precisions on set, bitset and arrayset

Olivier vidal_olivier at yahoo.fr
Fri Jan 14 20:06:46 CST 2005


OK, it is very clear!

I decided to replace in my project all the SQL cursors by the API, and 
obectPtrs by binary links.
The API of Valentina is really attractive! The 'sets' look like very 
powerful...

Thank you very much Ruslan

good evening !

olivier


> 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
> -------------------------------------------------------------
>
>
> _______________________________________________
> Valentina-beta mailing list
> Valentina-beta at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina-beta
>



More information about the Valentina-beta mailing list