BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TAdoData Master Detail Relationships

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (ADO)
View previous topic :: View next topic  
Author Message
Jeff Howard
Guest





PostPosted: Fri Feb 18, 2005 10:49 pm    Post subject: TAdoData Master Detail Relationships Reply with quote



I have been doing some stress testing with my new application that is using
Access as a database with my AdoDataSet2 having a master relationship with
the primary field of my AdoDataSet1. I have noticed that once I get up
around 50,000 records in my master table and 140,000 in my detail table (my
detail table has a primary key built upon the first 2 fields so about 3
records per master record) that to do a seek or next or prior is really
slow, sometimes up to 2-4 seconds to move the master cursor. If my detail
table is empty then it has no problem. I am using a server side cursor so
that I can use seek and build indexes.

Any thoughts as if I am doing something wrong is or is there too much
overhead associated with the master/detail relationship?


Back to top
yc
Guest





PostPosted: Sat Feb 19, 2005 4:13 pm    Post subject: Re: TAdoData Master Detail Relationships Reply with quote



Any thoughts that I can remember is
make sure that in your detail table the column you are using to seek is
indexed.
Hope it helps
yc

"Jeff Howard" <jhoward (AT) cubiscan (DOT) com> wrote

Quote:
I have been doing some stress testing with my new application that is using
Access as a database with my AdoDataSet2 having a master relationship with
the primary field of my AdoDataSet1. I have noticed that once I get up
around 50,000 records in my master table and 140,000 in my detail table (my
detail table has a primary key built upon the first 2 fields so about 3
records per master record) that to do a seek or next or prior is really
slow, sometimes up to 2-4 seconds to move the master cursor. If my detail
table is empty then it has no problem. I am using a server side cursor so
that I can use seek and build indexes.

Any thoughts as if I am doing something wrong is or is there too much
overhead associated with the master/detail relationship?




Back to top
Jeff Howard
Guest





PostPosted: Wed Feb 23, 2005 6:00 pm    Post subject: Re: TAdoData Master Detail Relationships Reply with quote



My detail table seems to be the table that is slowing things down. The
detail table has a primary key based upon the first two fields as well as a
indexed field on the first field of the detail table which is the field that
links back to the master table. When I try to navigate through the records
in the master table it is extremely slow when the master/detail link is
established (the master table has about 50k, and the detail table has about
125,000 records) for example to click the next button takes at least 1
second to respond. When I remove the master detail link then it is
instaneous.

Any thoughts as to why the performace is so bad with the master detail link
established and over 100,000 records?

Behind the scenes is this truly a sql join and therefore a performance pig?



"yc" <email (AT) test (DOT) com> wrote

Quote:
Any thoughts that I can remember is
make sure that in your detail table the column you are using to seek is
indexed.
Hope it helps
yc

"Jeff Howard" <jhoward (AT) cubiscan (DOT) com> wrote in message
news:42167281$1 (AT) newsgroups (DOT) borland.com...
I have been doing some stress testing with my new application that is
using Access as a database with my AdoDataSet2 having a master
relationship with the primary field of my AdoDataSet1. I have noticed that
once I get up around 50,000 records in my master table and 140,000 in my
detail table (my detail table has a primary key built upon the first 2
fields so about 3 records per master record) that to do a seek or next or
prior is really slow, sometimes up to 2-4 seconds to move the master
cursor. If my detail table is empty then it has no problem. I am using a
server side cursor so that I can use seek and build indexes.

Any thoughts as if I am doing something wrong is or is there too much
overhead associated with the master/detail relationship?






Back to top
Vitali Kalinin
Guest





PostPosted: Thu Feb 24, 2005 10:00 am    Post subject: Re: TAdoData Master Detail Relationships Reply with quote

Change yours detail table to parameterized query.


Back to top
Jeff Howard
Guest





PostPosted: Thu Feb 24, 2005 3:37 pm    Post subject: Re: TAdoData Master Detail Relationships Reply with quote

Thanks!

What about data shaping which means that I would remove the detail table and
create an additional field in the master table to hold the detail records?

I have not ever used data shaping so I have no idea if it works with Access
or if it is very effecient.


"Brian Bushay TeamB" <BBushay (AT) Nmpls (DOT) com> wrote

Quote:

My detail table seems to be the table that is slowing things down. The
detail table has a primary key based upon the first two fields as well as
a
indexed field on the first field of the detail table which is the field
that
links back to the master table. When I try to navigate through the records
in the master table it is extremely slow when the master/detail link is
established (the master table has about 50k, and the detail table has
about
125,000 records) for example to click the next button takes at least 1
second to respond. When I remove the master detail link then it is
instaneous.

Any thoughts as to why the performace is so bad with the master detail
link
established and over 100,000 records?

I think you are hitting the limits of what you can do with Access
serverside
cursors. I suggest you switch to using a clientside cursor at least for
the
detail data.
--
Brian Bushay (TeamB)
[email]Bbushay (AT) NMPLS (DOT) com[/email]



Back to top
Jeff Howard
Guest





PostPosted: Thu Feb 24, 2005 3:39 pm    Post subject: Re: TAdoData Master Detail Relationships Reply with quote

So would I just remove the master detail relationship and then use a query
with a where clause to get my detail records?


"Vitali Kalinin" <vitkalinin (AT) yahoo (DOT) com> wrote

Quote:
Change yours detail table to parameterized query.





Back to top
Vitali Kalinin
Guest





PostPosted: Thu Feb 24, 2005 4:20 pm    Post subject: Re: TAdoData Master Detail Relationships Reply with quote

Nope you should change CommandText of detail dataset to something like this:
select * from <DETAIL> where <MASTER_ID> = :MASTER_ID and thats all. If you
need exact syntax then show DDL for master and detail tables.


Back to top
Nick Kilpasis
Guest





PostPosted: Wed Apr 13, 2005 1:50 pm    Post subject: Re: TAdoData Master Detail Relationships Reply with quote

Can you give a sample with more than one master fields
I can;t make it work with Insert in detail table
"Vitali Kalinin" <vitkalinin (AT) yahoo (DOT) com> wrote

Quote:
Nope you should change CommandText of detail dataset to something like
this:
select * from <DETAIL> where <MASTER_ID> = :MASTER_ID and thats all. If
you
need exact syntax then show DDL for master and detail tables.





Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (ADO) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.