Re: Why overhead of SPI is so large?

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: pavel(dot)stehule(at)gmail(dot)com
Cc: tgl(at)sss(dot)pgh(dot)pa(dot)us, k(dot)knizhnik(at)postgrespro(dot)ru, tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Why overhead of SPI is so large?
Date: 2019-11-22 06:33:40
Message-ID: 20191122.153340.917828002561685014.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Fri, 22 Nov 2019 06:15:25 +0100, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> wrote in
> čt 21. 11. 2019 v 20:44 odesílatel Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> napsal:
>
> > Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> writes:
> > > čt 21. 11. 2019 v 10:31 odesílatel Konstantin Knizhnik <
> > > k(dot)knizhnik(at)postgrespro(dot)ru> napsal:
> > >> With contain_mutable_functions the patch becomes trivial.
> >
> > > Stable functions doesn't need own snapshot too, so it is not fully
> > correct,
> > > but it is on safe side.
> >
> > No, I doubt that. A stable function is allowed to inspect database state,
> > and if it's being called by a volatile function, it has every right to
> > expect that it'd see updates-so-far made by the volatile function.
>
> for this I need new snapshot?

It depends on what we regard as "query" or "command" here. It seems to
me that every line in a plpgsql function is regarded as a "query" for
stable function, even if the function is called in another "query".

In short, we need it, I think.

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2019-11-22 07:08:24 Re: Why overhead of SPI is so large?
Previous Message Tatsuo Ishii 2019-11-22 06:29:45 Re: Implementing Incremental View Maintenance