public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tom Lane <[email protected]>
To: Dave Cramer <[email protected]>
Cc: pgchem pgchem <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: C trigger significantly slower than PL/pgSQL?
Date: Wed, 12 Apr 2023 08:19:15 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <CADK3HH+_Vi4uoRaQmDSNPoZfAvm8A_NLQ87=EaXv1DxxXYrmsQ@mail.gmail.com>
References: <[email protected]>
	<CADK3HHJ0HtYy=6ErV69v9Emj2VsEkpJwvvcE-Rx9n1sDAAGrfw@mail.gmail.com>
	<[email protected]>
	<CADK3HH+_Vi4uoRaQmDSNPoZfAvm8A_NLQ87=EaXv1DxxXYrmsQ@mail.gmail.com>

Dave Cramer <[email protected]> writes:
> Fair. So to answer your question. The C function should be faster.

If we exclude basic coding errors (i.e. not really "equivalent"
processing) then a possible theory is that plpgsql is being careful
to cache a query plan that your C code is causing to be recomputed
each time.  But yeah, all else being equal plpgsql should be slower.

			regards, tom lane






view thread (9+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: C trigger significantly slower than PL/pgSQL?
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox