[V4RB 1] Creating Table from Cursor

Ruslan Zasukhin sunshine at public.kherson.ua
Mon Sep 4 22:28:53 CDT 2006


On 9/4/06 8:35 PM, "Carsten Friehe" <rblists at online.de> wrote:

Hi Carsten,

> I have a mail and newsreader with the following constellation:
> One table with the header-data (message-ID, Date, Group, Thread info etc.)
> this is a smaller table
> One table with the message-data (Body, Attachments etc.) this is a bigger
> table (more data)
> 
> Now I have a list in one window with a selection of the messages of one
> group. This list is using Einhugurs DataGrid and only displays and select
> some records of a small cursor (a join of both tables). This cursor only
> selects the data, the subject, the sender and some flags from one group and
> maybe only the unread messages.
> The second window will show the message-data of a selected row in the other
> window. This window also uses a cursor (a join of both tables) for all
> selected  messages of one group because you also could use it without the
> other list window. This cursor is bigger than the other because it selects
> the whole data of the two tables.
> 
> If the user bouble clicks a row in the list window it will be shown in the
> other window. This is an easy task because thetwo cursors correspond to
> each other because the where and order by clause are the same.
> If the user navigates in the message-data window to jump to the next
> message in the thread or to the previous message the selected row in the
> list-window changes too.

Cursor corresponds... You mean that they have the same number of records?
 
> This works without any problem. Now here are the problems.
> 
> There is a search function in the application which searches the messages
> for a text or something else. This search will do a select in the two
> tables and returns eg. the message-ID or something else what I will need to
> show the record in the list-window or the message-data window. But I will
> only get one record that has no corespondence to the other two cursors. The
> cursors for the list-window and the data-window should not be changed. They
> should only show the found row.
> What I thought of today is, that I can select the sorted fields which are
> used in the above cursors and do a binary search in one of the above
> cursors with this data.
> 
> Before I had no problem in doing these searches because the user could not
> change the sort order and I had a special field in every record of the
> header-data-table which was used for the sort order and so it was the
> current record of the resulting cursors. But now the user can change the
> sort order to what he likes as eg. sorted by message threads.
> 
> I hope that the problem is clearer now.

Yes I see your task. Problem started because you have no now SORTED column,
which could be hidden and used for binary search.

Yes you can try do binary search on column which is currently used for SORT.
Of course depending on its type you will get different groups by size with
the same values, and then you need do linear search in potentially small
group of records...

As I have told today morning, IF make sure that Vfield.FindValue() works on
cursor field, then this can give another speedup for such task because will
be touched only one field but not the whole cursor record when you do
iteration.

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