473,406 Members | 2,954 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

db2 trigger and foreign key constraint perfomace issue

Hi,

I m very new to DB2.
I m facing problem while creating a trigger on a table which has 5 milllions row

I am using stored procedure to update this table like this

update tan_detail set lst_id = 'RECFDM' where ack_no = in_parameter;

where ack_no has index created on it.

And calling this procedure using jdbc and it is taking 1 to 2 millisecond to complete (time calulated using java date time function).

But when i create simple trigger on this table like



CREATE TRIGGER PLT_STUPD_UPD AFTER UPDATE ON TAN_DETAIL
REFERENCING NEW AS N FOR EACH ROW MODE DB2SQL WHEN (N.LST_ID = 'HDDELV')
BEGIN ATOMIC

DECLARE LLST_ID VARCHAR(6);
DECLARE CNT INTEGER DEFAULT 0;

-- SET LLST_ID = LTRIM(RTRIM(VALUE(N.LST_ID,'')));



END
@

The time taken to run this procedure is increased to 250 to 400 millisecond and
we need to call this procedure 50000 thousand time during EOD and BOD. So it is not affordable.

Same perfomace degradation is noticed when i crate foreing key on lst_id column references to lcm_status_master which has 40 rows and reverse scan index also created on lst_id column

Any suggetion to solve this problem is very helpful or by defaul DB2 suffers performacne laking when creating trigger or foreing key?

Thx in advance

Devang.
Sep 9 '06 #1
0 2029

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Jason | last post by:
I have a table, SecurityMasterUnderlying, that has a 2 foreign key constraints to the same table (SecurityMaster). The first one is a one-to-one relationship. The second being a many-to-one. *...
9
by: Fernand St-Georges | last post by:
Hi, can someone tell how to write a Trigger; I am familiar with Sybase Sql Anywhere trigger syntax. Actually I have three tables MEMBER, CONTRACT and PAYMENT I need to update the MEMBER.BALANCE...
7
by: Justin | last post by:
I am extremely new at SQL Server2000 and t-sql and I'm looking to create a simple trigger. For explanation sake, let's say I have 3 columns in one table ... Col_1, Col_2 and Col_3. The data type...
7
by: rkrueger | last post by:
Given the following 3 Tables: CREATE TABLE ( NOT NULL , NOT NULL CONSTRAINT DEFAULT (getdate()), NULL , CONSTRAINT PRIMARY KEY CLUSTERED (
5
by: Peter Erickson | last post by:
I am running postgresql 7.4.2 and having problems creating a trigger function properly. I keep getting the following error: ERROR: OLD used in query that is not in rule I have a table called...
1
by: Bastian Blank | last post by:
I'm using postgresql 7.4.2 and COPY FROM don't trigger INSERT rules. Definitions: | CREATE TABLE log.package_status ( | version integer NOT NULL, | architecture integer NOT NULL, | ...
1
by: Robert Fitzpatrick | last post by:
I am running PostgreSQL 7.4.5 and have a trigger on a table called tblriskassessors which inserts, updates or delete a corresponding record in tblinspectors by lookup of a contact id and license...
8
by: Benzine | last post by:
Hi, I have an issue with my replication at the moment. I will try to describe the scenario accurately. I am using MS SQL 2000 SP4 with Merge Replication. Subscribers connect to the publisher...
3
by: Wojto | last post by:
Hi there! I need to write a trigger that will check referential integrity of my data. I have few FOREIGN KEY constraints but, as You probably konow, the cannot be deferred (in the meaning of SQL...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.