performance about trigger (after insert, update, delete)

From: Emi Lu <emilu(at)encs(dot)concordia(dot)ca>
To: pgsql-general(at)postgresql(dot)org
Subject: performance about trigger (after insert, update, delete)
Date: 2006-02-03 16:11:39
Message-ID: 43E380BB.2020702@encs.concordia.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-general by date

  From Date Subject
Next Message David Brain 2006-02-03 17:21:14 Re: Postgres 7.3.2 -> 8.1.2 upgrade performance issue
Previous Message David Brain 2006-02-03 16:05:12 Re: Postgres 7.3.2 -> 8.1.2 upgrade performance issue