Re: Subplan result caching

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Subplan result caching
Date: 2018-05-25 14:26:24
Message-ID: CA+Tgmoa9SOnygHgooUsoMNhx8Fa=v07G0wfuVoO4KkcJVyf29g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, May 23, 2018 at 12:51 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Ah. That would work, though it'd make the number of subquery executions
> even less predictable (since some logically-equal values would compare
> as physically unequal).

In most cases that seems fine. It might not be fine with the subquery
contains volatile functions, though. I think I'd be sad if I wrote a
query expecting random() to be executing 26000 times and it got
executed 11 times instead. But if the optimizer finds a way to
execute int4pl fewer times, that seems like a good thing.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2018-05-25 14:28:12 Re: Subplan result caching
Previous Message Tom Lane 2018-05-25 14:22:48 Re: Enhancement Idea - Expose the active value of a parameter in pg_settings