Re: Trigger performance - Mailing list pgsql-performance

From Tom Lane
Subject Re: Trigger performance
Date
Msg-id 12241.1074785874@sss.pgh.pa.us
Whole thread Raw
In response to Trigger performance  (pginfo <pginfo@t1.unisoftbg.com>)
List pgsql-performance
pginfo <pginfo@t1.unisoftbg.com> writes:
> I was supprised that the pgsql trigger take ~8 sec. to insert this rows
> and the "C" trigger take ~ 17 sec.

The reason is that plpgsql caches the plan for the invoked SELECT,
whereas the way you coded the C function, it's re-planning that SELECT
on every call.

            regards, tom lane

pgsql-performance by date:

Previous
From: postgres@countup.de
Date:
Subject: Function & Update/Insert Problem and Performance
Next
From: pginfo
Date:
Subject: Re: Trigger performance