TRIGGERS
Posted in 1998
Topics: Performance & Tuning, Triggers, Constraints & Referential Integrity
We are using the following in our product:
create table le_keys (
k_id serial unique,
k_key char(200),
k_servercode char(200),
k_keyclass integer check ( k_keyclass between 0 and 1 ),
k_keytype integer check ( k_keytype between 0 and 1),
k_feature char(15) NOT NULL,
k_nlic char(30),
k_start char(50),
k_exp char(50),
k_domain char(5),
k_vendor char(100),
k_authid char(40) NOT NULL,
k_desauthid char(40) NOT NULL,
k_prid integer references le_product (pr_id),
k_coid integer references le_company (c_id),
k_pid integer references le_person (p_id),
k_plat integer references le_platform (pl_id),
k_lastupdated DATETIME YEAR TO FRACTION DEFAULT CURRENT,
k_price money default 0,
primary key (k_keyclass, k_feature, k_authid)
) ;
CREATE TRIGGER le_keys_trigger UPDATE
OF k_key,k_servercode,k_keyclass,k_keytype,
k_feature,k_nlic,k_start,k_exp,k_domain,
k_vendor,k_authid,k_desauthid,k_prid,
k_coid, k_pid,k_plat ON le_keysREFERENCING NEW AS n
FOR EACH ROW (
UPDATE le_keys SET k_lastupdated=CURRENT
WHERE k_id=n.k_id );
I am worried about the TRIGGER part. It was written by an ex employee and
I am not sure about the performance hit we can expect when used on large
tables (>50000 rows).
Any Ideas?
/Erik