Re: pl/pgsql functions outperforming sql ones?

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Carlo Stonebanks <stonec(dot)register(at)sympatico(dot)ca>
Cc: Merlin Moncure <mmoncure(at)gmail(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: pl/pgsql functions outperforming sql ones?
Date: 2012-01-31 04:56:27
Message-ID: CAFj8pRBC2G38LctvcSnvAjsAZD8=r_xm6KSYeFog-td6927U4Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

2012/1/31 Carlo Stonebanks <stonec(dot)register(at)sympatico(dot)ca>:
> Pavel, thank you very much for your explanation.
>
> Is it possible to define under what conditions that sql procs will
> outperform plpgsql ones, and vice-versa?

yes, little bit :)

when inlining is possible, then SQL function will be faster - typical
use case is simple scalar functions (with nonvolatile real
parameters).

Regards

Pavel

>
> -----Original Message-----

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message CSS 2012-01-31 08:07:51 rough benchmarks, sata vs. ssd
Previous Message Josh Berkus 2012-01-31 00:42:02 Re: Why should such a simple query over indexed columns be so slow?