ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Insert queries on table having triggers on it , Using ESQL.

Post new topic  Reply to topic
 Insert queries on table having triggers on it , Using ESQL. « View previous topic :: View next topic » 
Author Message
santhoshMB
PostPosted: Sun Mar 11, 2012 10:00 pm    Post subject: Insert queries on table having triggers on it , Using ESQL. Reply with quote

Newbie

Joined: 08 Mar 2012
Posts: 1

I have 2 tables(Master and Child) which have primary and foreign key relationship. A trigger is applied on the Master table which inserts data into some Back up table. Also before the delete is performed on the Master and Child table the foreighn key constraint is removed and then a delete is performed for both the tables and then a commit is done.This delete is performed as the first step to clear the dB.

When I am passing small input which insert 100-200 rows in the table the complete operation is done in 1 min. But when I pass a bulk input which inserts some 80,00 rows it takes 2 hours.

When the triggers is removed from the Master table same input when it is passed it inserts 80,000 records in 5 mins.

What can be the problem and how can I rectify it.

Thanks,
Back to top
View user's profile Send private message
smdavies99
PostPosted: Sun Mar 11, 2012 10:40 pm    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

IMHO, this question may well get a better response from a DB Designer/Developer.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Mar 12, 2012 4:38 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

smdavies99 wrote:
IMHO, this question may well get a better response from a DB Designer/Developer.




This sounds a lot like a database tuning / design issue rather than anythig WMB is doing.

You should cross post in a forum associated with your db software.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mqsiuser
PostPosted: Mon Mar 12, 2012 5:36 am    Post subject: Re: Insert queries on table having triggers on it , Using ES Reply with quote

Yatiri

Joined: 15 Apr 2008
Posts: 637
Location: Germany

Delete/Insert smaller portions of your data (e.g. one parent row + all child rows). The performance-degradation likely comes from the "huge transactional context" that you create. Try to have a couple of small(er) transactions.

Have a look if you db-Schema has (or has not) "on delete cascade"... look how it works and if it can help you in splitting deletion into: Child-Table-rows first, then parent-table-row(s) ... well I am not sure ... but I think it works like "Delete parent rows will also trigger deletion of child rows"

What does the trigger do (I guess it triggers something performance intense)

Your transactional context is too big ! Do more commits from time to time

Removing the foreign key(s)... look at "on delete cascade" instead: You should not change you db-design when you want to delete data.
_________________
Just use REFERENCEs
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Mar 12, 2012 5:42 am    Post subject: Re: Insert queries on table having triggers on it , Using ES Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

mqsiuser wrote:
Delete/Insert smaller portions of your data (e.g. one parent row + all child rows). The performance-degradation likely comes from the "huge transactional context" that you create. Try to have a couple of small(er) transactions.

Have a look if you db-Schema has (or has not) "on delete cascade"... look how it works and if it can help you in splitting deletion into: Child-Table-rows first, then parent-table-row(s): E.g.: Delete the records in child table, then delete the rows in the parent table.

What does the trigger do (I guess it triggers something performance intense)

Your transactional context is too big ! Do more commits from time to time

Removing the foreign key(s)... look at "on delete cascade" instead: You should not change you db-design when you want to delete data.


Some or all of which very good suggestions may require the assistance of a qualified db person unless the OP has the knowledge & access to achieve this. Which seems unlikely given they posted the question.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Insert queries on table having triggers on it , Using ESQL.
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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.