Moving from Vcursor to Vsets

Ruslan Zasukhin sunshine at public.kherson.ua
Fri Jul 20 03:09:43 CDT 2007


On 20/7/07 1:30 AM, "Dave Addey" <listmail1 at dsl.pipex.com> wrote:

Hi Dave,

> Hi there,
> 
> I¹m trying to split up my SELECT statements into smaller chunks, using VSets
> and the FindXxxx methods.  I¹m wondering ­ how would I select a primary key
> such as this:
> 
> SELECT * FROM Tracks, PlaylistTracks WHERE PlaylistTracks.TrackUniqueIDPtr =
> Tracks.UniqueID AND PlaylistTracks.PlaylistUniqueIDPtr = 3

And how you DISPLAY/USE this cursor later?
 
> (PlaylistTracks.TrackUniqueIDPtr is a Foreign Key Link to Tracks.UniqueID,
> and PlaylistTracks.PlaylistUniqueIDPtr is a Foreign Key Link to
> Playlists.UniqueID)
> 
> ...using VSets?  I can see how to do the individual selects using VSets, but
> I can¹t see how to join the two together with the foreign key links.


Vsets and joins ==== it needs change mind :)

* SQL JOIN produce NEW TABLE that have fields of other tables.

* this new table already LOOSE info about original entities: Tracks and
PlayList.

* SETS in contrast allow you keep this info, but require a lots more manual
work. And I am not sure that in REVOLUTION its very good idea to use SETs
for intensive calculation (or with vserver).

Sets can give you win if you really will reduce with them access to db info.


------------------------------
Steps are:

1) SEARCH in PlaylistTracks table

    set1 = PlaylistTracks.PlaylistUniqueIDPtr.FindValue( 3 )

2) FIND linked records from table Tracks

    set2 = linkFK.FindLinked( PlaylistTracks, Tracks, set1 )
    

> I¹ve been doing it the VCursor way so far, but some of my SELECT statements
> take too long to execute, so I want to chop them up into smaller chunks.
> I¹m thinking of doing this using several VSet methods, each of which reduces
> the set another step, bit by bit.

May be better find why they are slow. May be indexes are missing.



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