time penalties on triggers?

From: "Jan Theodore Galkowski" <bayesianlogic(at)acm(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: time penalties on triggers?
Date: 2007-10-04 18:46:29
Message-ID: 1191523589.7753.1214187731@webmail.messagingengine.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Does anyone know, or can anyone point to information about how much
triggers penalize inserts in PG tables? I'm getting a report that it is
substantial, and before I investigate more. The triggers in question
look like:
#
# CREATE OR REPLACE FUNCTION touch_lasttouched() RETURNS TRIGGER AS
$touch_lasttouched$
# BEGIN
# NEW.lasttouched = NOW();
# RETURN NEW;
# END;
# $touch_lasttouched$ LANGUAGE plpgsql;

#
# DROP TRIGGER IF EXISTS trigger_touch_ams_faults_data ON
ams_faults_and_failures_data;
#
# CREATE TRIGGER trigger_touch_ams_faults_data
# BEFORE INSERT OR UPDATE
# ON ams_faults_and_failures_data
# FOR EACH ROW
# EXECUTE PROCEDURE touch_lasttouched();
#

Here the "lasttouched" column of a table is like:
#
# lasttouched TIMESTAMP(6)
#

and is intentionally left nullable.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Mike Ginsburg 2007-10-04 19:26:41 Large Result and Memory Limit
Previous Message Michael Glaesemann 2007-10-04 18:04:25 Re: good sql tutorial