Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM Client/Server » View Thread |
Messages 1 to 9 of 9 total |
open table filtered? or indexed? |
Thu, Jun 29 2006 5:44 AM | Permanent 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 AM | Permanent Link |
Roy Lambert NLH Associates 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 AM | Permanent 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 AM | Permanent 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 AM | Permanent 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 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. 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 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. 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 PM | Permanent 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 PM | Permanent 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 |
This web page was last updated on Saturday, May 4, 2024 at 12:54 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |