Board index » delphi » Filter a range of records in pdox table

Filter a range of records in pdox table

Paradox 5.x, D3.

I have some tables with 200K+ records from which I need to rapidly and
repeatedly retrieve a small number of records (typically < 30). I was doing
this with a range and a filter. However as the files have grown this
solution has drastically slowed response times. The problem appears to be
that the filter is applied to all records and then the range is applied to
the filtered records. Is this an accurate assumption?

If it is, then what can I do to apply a range to each of the tables and then
filter only those records in the range? (Unfortunately simply going through
the ranged table and picking out the records that are needed is not an
option since the tables are used by some 3rd party components that are not
easily replaced.)

More Info: The fields that are tested in the filters are not usually
indexed. But the range narrows down the record count to < 40. I tried using
queries and response was even worse.

 

Re:Filter a range of records in pdox table


Re:Filter a range of records in pdox table


Further investigations revealed that a piece of code was setting the filters
without the ranges being applied.

Quote
"Bruce Roberts" <no.junk.please....@attcanada.net> wrote in message

news:vsbh4.18608$j%2.1317@cabot.ops.attcanada.net...
Quote
> Paradox 5.x, D3.

> I have some tables with 200K+ records from which I need to rapidly and
> repeatedly retrieve a small number of records (typically < 30). I was
doing
> this with a range and a filter. However as the files have grown this
> solution has drastically slowed response times. The problem appears to be
> that the filter is applied to all records and then the range is applied to
> the filtered records. Is this an accurate assumption?

> If it is, then what can I do to apply a range to each of the tables and
then
> filter only those records in the range? (Unfortunately simply going
through
> the ranged table and picking out the records that are needed is not an
> option since the tables are used by some 3rd party components that are not
> easily replaced.)

> More Info: The fields that are tested in the filters are not usually
> indexed. But the range narrows down the record count to < 40. I tried
using
> queries and response was even worse.

Re:Filter a range of records in pdox table


Re:Filter a range of records in pdox table


Quote
Bruce Roberts (no.junk.please....@attcanada.net) wrote:

: Paradox 5.x, D3.

: I have some tables with 200K+ records from which I need to rapidly and
: repeatedly retrieve a small number of records (typically < 30). I was doing
: this with a range and a filter. However as the files have grown this
: solution has drastically slowed response times. The problem appears to be
: that the filter is applied to all records and then the range is applied to
: the filtered records. Is this an accurate assumption?

: If it is, then what can I do to apply a range to each of the tables and then
: filter only those records in the range? (Unfortunately simply going through
: the ranged table and picking out the records that are needed is not an
: option since the tables are used by some 3rd party components that are not
: easily replaced.)

You're right in your assumptions.  And, yes, a query would be even slower.
What you want to do, in pseudocode:

Turn off screen updates (the method name escapes me right now)
Table1.Filtered = False;
Table1.SetRange...
Table1.Filtered = True;
Allow screen updates
--
Rick Carter
carte...@email.uc.edu

Other Threads