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.