Re: Trigger performance

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pginfo <pginfo(at)t1(dot)unisoftbg(dot)com>
Cc: "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Trigger performance
Date: 2004-01-22 15:37:54
Message-ID: 12241.1074785874@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

pginfo <pginfo(at)t1(dot)unisoftbg(dot)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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message pginfo 2004-01-22 16:05:35 Re: Trigger performance
Previous Message pginfo 2004-01-22 15:31:34 Re: Trigger performance