Topic for all time: I'm trying to speed up TBrowse with a filter. I have a DBF table with about 30,000 records on server. The user can enter a complex condition (can not be optimized by the index). I want to allow him to browse filtered table. I've alredy tried some solutions like creating a temporary conditional index but with no succes. Create index is not a good solution because the user waits too long for the index creating. Other solution is SET FILTER. This command is slow because for all records always test the condition again and again. For example, if the first few records satisfy the condition, Ctrl-PgDn will always check all the remaining 30,000 records. Of course, it is sometimes necessary. But what if the condition always (approximately) gives the same results?
I was thinking about a new temporary table that stores numbers of records that satisfy the condition and number of previous and the next ok records. When the browse is activated, the table is filled with the first few records. As the user moves the cursor, the table is filled with new data. But, if the user re-crosses the records already in the table, the view is much faster. Last record was clearly set, and Ctrl-PgDn will not check thousands of unnecessary records. The problem is implementation - requires quite a change and need to change Tbrowse:Skip, goTop, goBottom... Some sort of system support there'd be more than welcome in my opinion.
What is your opinion?
Regards, NB
I was thinking about a new temporary table that stores numbers of records that satisfy the condition and number of previous and the next ok records.
Topic for all time: I'm trying to speed up TBrowse with a filter. I have a DBF table with about 30,000 records on server. The user can enter a complex condition (can not be optimized by the index). I want to allow him to browse filtered table. I've alredy tried some solutions like creating a temporary conditional index but with no succes. Create index is not a good solution because the user waits too long for the index creating. Other solution is SET FILTER. This command is slow because for all records always test the condition again and again. For example, if the first few records satisfy the condition, Ctrl-PgDn will always check all the remaining 30,000 records. Of course, it is sometimes necessary. But what if the condition always (approximately) gives the same results?
I was thinking about a new temporary table that stores numbers of records that satisfy the condition and number of previous and the next ok records. When the browse is activated, the table is filled with the first few records. As the user moves the cursor, the table is filled with new data. But, if the user re-crosses the records already in the table, the view is much faster. Last record was clearly set, and Ctrl-PgDn will not check thousands of unnecessary records. The problem is implementation - requires quite a change and need to change Tbrowse:Skip, goTop, goBottom... Some sort of system support there'd be more than welcome in my opinion.
What is your opinion?
Regards, NB
--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
All everybody says is interesting but nenad asked for set filter not using indexes
Obviously an interesting topic :)
I thought about some details. For example, suppose that
the main table is:
1 ok
2
3
4 ok
5 ok
6 ok
7
8
9 ok
10
11
Let's say that it is indexed by record number, but that
does not matter. Records 1, 4, 5, 6, 9 satisfy the condition, and should be
seen in tbrowse. Program uses a temporary table like this (I hope that Google
will not spoil this table):
rec
go prev
----- -----
------
1
1
0
2
4
3
4
4
4
1
5
5
4
6
6
5
7
9
8
9
9
9
6
10 9
11 9
The field REC is the original record number (table has an index on that field). Field GO keeps the correct record number. For example, if the user tries to go on record 5, he remains on same record, because it meets the condition (REC=GO). But if the user tries to jump to a record 7, the cursor is moved to record 9, because it was the first proper record. SKIP operations are now easily implemented. This table is initially empty and is filled as the user moves the cursor up and down.
I think this can be implemented without major changes the
main code.
Regards, NB
I thought about some details. For example, suppose that the main table is:
1 ok
2
3
4 ok
5 ok
6 ok
7
8
9 ok
10
11
Records 1, 4, 5, 6, 9 satisfy the condition, and should be seen in tbrowse. Program uses a temporary table like this (I hope that Google will not spoil this table):
rec go
----- -----
1 1
2 4
3 5
4 6
5 9
This table is initially empty and is filled as the user moves the cursor up and down.
Thanks, this is helpful information. Whether this applies to other Harbour RDD or just RMDBFCDX?
But my problem is not related to the deleted records. I need a way to efficiently filter a large group of records from the table.
Regards, NB
--
Of course, it's always good to hear more opinions and information :)
--
I must say that all the solutions we're talking about is only part of the final solution. The solution is simple data server that could execute operations such as filtering, indexing, etc.. There is ADS, but it is very expensive and I have the impression that less attention is paid to DBF support. I think a simple, efficient and cost effective data server (eg, based on NetIO) was hit in the center of the target.
Regards, NB
From: harbou...@googlegroups.com [mailto:harbou...@googlegroups.com] On Behalf Of G3...@aol.com
Sent: Monday, July 29, 2013 1:24 PM
To: harbou...@googlegroups.com
Subject: Re: [harbour-users] Re: SET FILTER speed up
Hi All
--
But my problem is not related to the deleted records. I need a way to efficiently filter a large group of records from the table.
LetoDB is interesting, but I read some posts here about some bugs. Also, I do not see any work on it, and it was a bit disturbing. I saw some Russian forums that have a lot of messages about LetoDB, but I have not yet read.
Of course, any additional experience are welcome.
NB