pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Tom Lane <tgl@sss.pgh.pa.us>
To: Amit Langote <amitlangote09@gmail.com>
Cc: Pavel Stehule <pavel.stehule@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Subject: Re: plan cache overhead on plpgsql expression
Date: Thu, 26 Mar 2020 13:39:52 -0400
Message-ID: <21557.1585244392@sss.pgh.pa.us> (raw )
In-Reply-To: <CA+HiwqG2FnRmZJVLZxeTK48h+fiXVA+Rht7fqE9yJLRH7fZ3cw@mail.gmail.com >
References: <CAFj8pRDRVfLdAxsWeVLzCAbkLFZhW549K+67tpOc-faC8uH8zw@mail.gmail.com >
<CA+HiwqGt8P4YKYP+wJvkzbZgYSt4fgVYCC9A_enR0YJAcra0Uw@mail.gmail.com >
<CAFj8pRC1yOx1uMRCkEW8NRbqVgmaZoAqp7KEQ9-46P4UQeARFQ@mail.gmail.com >
<CA+HiwqEogrbu_jzuyG_mgtX3yF7L5_yVgBiqXFRxPMQwzWS7mQ@mail.gmail.com >
<CA+HiwqHOnO4+TriKOF021To3018j5pXAO_ySgi1rqt7MfMtu5w@mail.gmail.com >
<CAFj8pRAgX-cTRfNcpZEPutOLbVJji10J2L1fAzCbkFxmN_w=LA@mail.gmail.com >
<CAFj8pRD8JtW71hpcQfOD6kguQut51qHPX3bVZXXZtC7=VB0Cbg@mail.gmail.com >
<CA+HiwqHuEmzTnYZaJp8D14VCc127dnAKdAWZoV-b6U7oO_oOJg@mail.gmail.com >
<CA+HiwqEFt+cJUi=DLxmynYwFwWrC3mQMUSMcYefxU-5jgaeWew@mail.gmail.com >
<CAFj8pRBVeseNF+jDaZOrC0-W540Mx-DAEvELMeveJs10L9i=Rg@mail.gmail.com >
<CAFj8pRBH2T=7VoTrY7hf5MNUWE45zZpdWWvv+hzEem=Wn3GcNg@mail.gmail.com >
<1478.1584815045@sss.pgh.pa.us >
<CAFj8pRDCJcv6RwrVdceQVx_Ct0uxADmZN51nv=Z9Z0QBy68K+g@mail.gmail.com >
<CAFj8pRDGa8MN9wowaS0J+t6LAnBZDmWjH0it-CO_YLKZfL3qAg@mail.gmail.com >
<11126.1585165468@sss.pgh.pa.us >
<CA+HiwqG2FnRmZ! JVLZxeTK48h+fiXVA+Rht7fqE9yJLRH7fZ3cw@mail.gmail.com >
Amit Langote <amitlangote09@gmail.com> writes:
> One thing -- I don't get the division between
> CachedPlanAllowsSimpleValidityCheck() and CachedPlanIsSimplyValid().
> Maybe I am missing something, but could there not be just one
> function, possibly using whether expr_simple_expr is set or not to
> skip or do, resp., the checks that the former does?
Well, we don't want to do the initial checks over again every time;
we want the is-valid test to be as simple and fast as we can make it.
I suppose we could have one function with a boolean flag saying "this is a
recheck", but I don't find that idea to be any better than the way it is.
Also, although the existing structure in plpgsql always calls
CachedPlanIsSimplyValid immediately after a successful call to
CachedPlanAllowsSimpleValidityCheck, I don't think that's necessarily
going to be true for other potential users of the functions.
So merging the functions would reduce flexibility.
regards, tom lane
view thread (41+ messages) latest in thread
Message-ID: <21557.1585244392@sss.pgh.pa.us>
Permalink: ../21557.1585244392@sss.pgh.pa.us/
Also on: postgresql.org/message-id/21557.1585244392@sss.pgh.pa.us
copy link · copy postgr.es
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: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, amitlangote09@gmail.com, pavel.stehule@gmail.com
Subject: Re: plan cache overhead on plpgsql expression
In-Reply-To: <21557.1585244392@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox