Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 9 of 9 total
Thread open table filtered? or indexed?
Thu, Jun 29 2006 5:44 AMPermanent Link

"Santy Concepción"
Hi!

I open all the tables when I launch the application, and I'm trying to make
the application faster when it opens...

Just for testing, I made a simple application (C/S mode) to watch what is
the fastest method to open the tables. Filtered, Indexed, etc...
The table contains about 1000 records. It has 4 indexes.

Here are the results (in milliseconds):

1) table.filter := 'MOV = ''A''';                 //string field
   table.filtered := true;
   table.open;

   TIME = 1288 ms

2) table.open;

   TIME = 950 ms

3) table.indexname := 'indexname';          //integer field
   table.open;

   TIME = 1110 ms

Why it is faster opening the table without filter nor index? Is it normal?

Which is the better/faster method to open all the tables?

(I'm using last version of DBISAM 4)

Thanks!

Thu, Jun 29 2006 6:48 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Santy


If you just open a table its does that

if you open with a filter it has to open it and apply the filter

if you open it with a different index it has to open it and change the index


I would regard it as perfectly normal - its doing more work it takes longer.

Fastest way to open a table - as is and unconnected to any controls and without any lookup fields, calculated fields or master/detail links.

Roy Lambert
Thu, Jun 29 2006 7:17 AMPermanent Link

"Ralf Mimoun"
Santy Concepción wrote:
> Hi!
>
> I open all the tables when I launch the application, and I'm trying
> to make the application faster when it opens...

That's easy: don't open all tables at startup.

Ralf
Thu, Jun 29 2006 7:40 AMPermanent Link

"Santy Concepción"
Hi, Roy...

> ...... its doing more work it takes longer.

The Server is doing all the job...
If I filter the table, the Server should send me ONLY those filtered
records, not all.
If I open it already filtered... What does the Server send to me?

You'll see what I mean with this example:
Why 10 records (filtered) takes more time than 500 records (not filtered).
Who applies the filter? Server or Client?

Thu, Jun 29 2006 9:49 AMPermanent Link

"Ralf Mimoun"
Santy Concepción wrote:
> Hi, Roy...
>
>> ...... its doing more work it takes longer.
>
> The Server is doing all the job...
> If I filter the table, the Server should send me ONLY those filtered
> records, not all.
> If I open it already filtered... What does the Server send to me?

The server never send you all records. Just the current one, all records
needed eg. for a grid to show, and some more for the buffers. Using a filter
does not change the number of records sent to the client.

And you don't open it "filtered". The server opens the table and _then_
applies the filter. That second step will need at least some time,
especially if you don't define an appropiate index. In your case a case
sensitive index on field "MOV".

Ralf
Thu, Jun 29 2006 2:50 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Santy,

<< Why it is faster opening the table without filter nor index? Is it
normal? >>

Applying filters and/or switching the active index involves more round-trip
request/responses to the database server, hence it will incur more time.
You can view this extra activity and compare it to the plain Open using the
TDBISAMSession.RemoteTrace property:

http://www.elevatesoft.com/dbisam4d5_tdbisamsession_remotetrace.htm

--
Tim Young
Elevate Software
www.elevatesoft.com

Thu, Jun 29 2006 2:56 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Santy,

<< The Server is doing all the job... >>

Yes, when it comes to the actual work.  However, due to the way the TDataSet
component architecture works, the TDBISAMTable must first send a "table
open" request to the database server, then it sends a "set the filter"
request to the database server.  This incurs more delay due to the latency
in the network transmission of the request/response messages.

<< If I filter the table, the Server should send me ONLY those filtered
records, not all. >>

It does exactly that, but only *after* the the table is opened (see above).

<< If I open it already filtered... What does the Server send to me? >>

It sends whatever records are needed at table open time, and then after the
filter is set is sends the filtered records. See my previous message - if
you use the remote tracing, you can see for yourself what is being
sent/received in terms of requests/responses and where the time delay is
being incurred.

<< You'll see what I mean with this example:
Why 10 records (filtered) takes more time than 500 records (not filtered).
>>

Network turnaround time on the request/response pairs.

<< Who applies the filter? Server or Client?  >>

The server, provided that you're not using the OnFilterRecord event handler.

--
Tim Young
Elevate Software
www.elevatesoft.com

Sat, Jul 1 2006 3:45 PMPermanent Link

"JohnE"
> Here are the results (in milliseconds):
>
> 1) table.filter := 'MOV = ''A''';                 //string field
>    table.filtered := true;
>    table.open;
>
>    TIME = 1288 ms


Have you tried using a TDBISAMQuery component?  Try
Select * where MOV = "A" , then open and report
the benchmark.

John

Sat, Jul 1 2006 6:15 PMPermanent Link

"Ralf Mimoun"
JohnE wrote:
....
> Have you tried using a TDBISAMQuery component?  Try
> Select * where MOV = "A" , then open and report
> the benchmark.

And don't forget to set RequestLive := True before opening the query.

Ralf
Image