Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Am I pulling all data across the network ?

Status
Not open for further replies.

StevenK

Programmer
Jan 5, 2001
1,294
GB
We have a form within an application that works on a master-detail relationship. The detail part being a query component with syntax something like :
'SELECT Field1, Field2, Field3 FROM Table2 WHERE Field3=:Fieldx'
with Fieldx being the field to link to in the 'master' part of the relationship.
This means that when we are focused on one record in the 'master' table/query then we have the associated records in the 'detail' query.
My question is this :
If we close and then open the 'detail' dataset (forcing a refresh in effect) are we pulling all the data across the network for Table2 or just those records that are associated with the current record in the 'master' dataset ?
Any advice would be appreciated.
Thanks in advance.
Steve.
 
Hi StevenK,

Well, since you do this through a query you should get the
records that are associated with the current record in the 'master' dataset. It should read the 'master' dataset
remotely and then only get the records that are compliant
with the query.

I hope this helps,

BobbaFet Everyone has a right to my opinion.
E-mail me at cwcon@programmer.net
Be a nice guy 'n press that little ol' button
VVV---(this one) for me ;-)
 
Actualy you return only the records you asked. When you scroll in the master table, the query is fired. S. van Els
SAvanEls@cq-link.sr
 
So by scrolling the records in the 'master' part of the relationship the 'detail' dataset query is being re-fired against the data (on the server). Would anyone strongly advise against this - a colleague has suggested that we introduce an additional button that the user has to use to refresh the 'detail' dataset - but this may lead to some confusion with mis-association between supposed 'header' and lines (but would prevent the query being re-fired each time the record in the 'master' dataset is scrolled).
Anyone use a principal like this with no hard impact on application performance ?
Thanks again
Steve
 
I don't think it will cause a problem. I'm not sure with Delphi handling the firing of the detail query - if you have trouble with people scrolling through the master records and it firing each time, slowing everything down, you could add a timer which resets each time they scroll and doesn't actually kick off the detail load until they've paused for a millisecond or so.

Like I said though, I'm not sure if Delphi already does something like this behind the scenes with it's master/detail implementation. I've had to do this sort of thing when I was firing the detail load myself.

Good luck!
TealWren
 
Mostly you will use queries against RDBMS systems like Oracle, SQL server, Interbase in a Client-Server relation ship. These servers can handle the load of multiple queries. In fact looking at most delphi books about databases, tables are mostly just for desktop systems like access, dbase and paradox.
I do not think that it will put an extra load on your network traffic.

Regards S. van Els
SAvanEls@cq-link.sr
 
I've put together a small test application to determine speed of processing within master-detail relationships for TQuery components running against Paradox tables. When I link 2 Paradox tables using key fields through TTable components and performing a 'while not EOF' on the 'master' dataset and for each performing a 'while not EOF' on the 'detail' dataset (that is for header 1 I run through all the associated lines, move to header 2 and run through all its associated lines, etc).
Using TTable components this process takes me about 1 second (total number of detail lines = 1500).
When creating the same link through TQuery components (through the same key fields) using a master-detail relationship the same cycling process takes me about 37 seconds. This is a significant difference.
This is when the Paradox tables are resting on the client machine. When the tables are accessed from the network the time taken for the TQuery process is multiplied up.
Can anyone explain this ?
It indicates that I may well be pulling all the data records for the 'detail' dataset and then performing a filter on these entries according to the 'master' record currently being viewed.
Any suggestions ?
Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top