Collection Object

Ruslan Zasukhin sunshine at public.kherson.ua
Mon Jul 31 19:10:02 CDT 2006


On 7/31/06 5:58 PM, "Philip Mötteli" <philip.moetteli at econophone.ch> wrote:

>> Can you make more details on this?
> 
> As we found out, the normal use of a DBMS from an OO-program consists
> of referencing records/objects. For this application an OODBMS is
> much better suited. But NSArray/NSMutableArray also offers these
> methods:
> 
> - (NSArray *)filteredArrayUsingPredicate:(NSPredicate *)predicate
> 
> - (void)filterUsingPredicate:(NSPredicate *)predicate
> 
> 
> These methods actually access the internals/IVars/fields of the
> member objects/records.

> We could achieve a huge performance acceleration, if, instead of
> deserializing all the member objects/records into RAM and applying
> the predicate/query there, we let do this on the DBMS side.

I see. 

Also let me remind:

    Valentina keep columns as separate logic files.

    Even when you do scan by column f1,
    into RAM is loaded only this column data

> So the NSPredicate would produce some SQL output, which would be sent
> to the server, which would apply an SQL statement like this to the
> collection table (NSSet,Š)(I'm not an SQL expert!):
> 
> SELECT *
> FROM NSSet
> WHERE a.x = y;
> 
> And we would deserialize only the resulting OIDs.

Lets on example:

Table TC have next records with arrays, I will use simple values for OIDs to
simplify

Table NSSet
-------------------------------------------------
RecID   f1      f2          f3 - Array
 1      4       sdf         { 2, 3, 7, 9, 12 }
 2      8       dfgd        { 3, 8, 10, 15 }
 3      2       fhgf        { 4, 7, 11, 13, 24, 32, 45, 68 }

Now we do SQL query

    SELECT RecID
    FROM  NSSet
    WHERE f3.contains( 7 )

Result - cursor on table NSSet with 2 records with RecIds of NSSet

        ------------
cursor    RecID
        -------------
            1
            3


Also we can want do

    SELECT RecID, f3
    FROM  NSSet
    WHERE f3.contains( 7 )

        ---------------------------------------------
cursor      RecID    f3
        ----------------------------------------------
            1       { 2, 3, 7, 9, 12 }
            3       { 4, 7, 11, 13, 24, 32, 45, 68 }

Or you think about something else?

AS RESULT of search we must find NSSet instances, right ?

Actually I think here can be few variants ...


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