performance about trigger (after insert, update, delete) - Mailing list pgsql-general

From Emi Lu
Subject performance about trigger (after insert, update, delete)
Date
Msg-id 43E380BB.2020702@encs.concordia.ca
Whole thread Raw
List pgsql-general
Hello,

I have a question about the performance of trigger/trigger functions.

For example, I had a trigger setup as :

*CREATE TRIGGER track_tableOperation AFTER INSERT OR UPDATE OR DELETE **ON tableName FOR EACH ROW** EXECUTE PROCEDURE
tracking_info(); 

A track table as:
( table_name, username,  updated_table_prim_key, time_stamp, action )
table_name:              which table is changed
username:                who does the change
updated_table_prim_key:  primary key column values
time_stamp:              default now()
action:                  added, deleted, updated, etc.
*

I have 50 tables, whenever there is a change (update, insert, delete) ,
I'd like to track this action and saved into my track table.

If I design triggers for all these 50 tables, whenever there are changes
for the table (Let's say users changed record values from GUI), a
trigger function is run and values are saved into track table
automatically.

I'd like to know the performance about the above way for tracking table
values updates. Your comments are very welcomed.

Emi



pgsql-general by date:

Previous
From: David Brain
Date:
Subject: Re: Postgres 7.3.2 -> 8.1.2 upgrade performance issue
Next
From: David Brain
Date:
Subject: Re: Postgres 7.3.2 -> 8.1.2 upgrade performance issue