pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
To: pgsql-hackers@postgresql.org
Subject: Re: Cached plans and statement generalization
Date: Wed, 26 Apr 2017 10:00:17 +0300
Message-ID: <f5d50b64-0c83-369e-3a5b-789a93ed0cbe@postgrespro.ru> (raw )
In-Reply-To: <20170425214746.3mngxgbo7yndfgax@alap3.anarazel.de >
References: <8e76d8fc-8b8c-14bd-d4d1-e9cf193a74f5@postgrespro.ru >
<20170424184353.u2krt2eiw2l6e2af@alap3.anarazel.de >
<f0bfcdd6-dba3-e9a8-2108-146e1f880839@postgrespro.ru >
<CBF37923-CDA5-48EF-9E9E-4A338D7988ED@rielau.com >
<1f4c1a22-ecbe-811d-4695-ee4701b8f6c7@postgrespro.ru >
<e85343e6-5ab5-447c-9995-5cce992fedf3@rielau.com >
<58FFB391.5080101@postgrespro.ru >
<C0064A85-7CE9-44E6-B14F-98E541B328FD@rielau.com >
<58FFB5F0.2020900@postgrespro.ru >
<CAP6UvaMjiumn5-Lre_w11j=ZAOB9auO1x=-meTKsWRfcsQ7Pcw@mail.gmail.com >
<20170425214746.3mngxgbo7yndfgax@alap3.anarazel.de >
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
On 26.04.2017 00:47, Andres Freund wrote:
> On 2017-04-25 21:11:08 +0000, Doug Doole wrote:
>> When I did this in DB2, I didn't use the parser - it was too expensive. I
>> just tokenized the statement and used some simple rules to bypass the
>> invalid cases. For example, if I saw the tokens "ORDER" and "BY" then I'd
>> disallow replacement replacement until I hit the end of the current
>> subquery or statement.
> How did you manage plan invalidation and such?
The same mechanism as for prepared statements.
Cached plans are linked in the list by SaveCachedPlan function and are
invalidated by PlanCacheRelCallback.
> - Andres
>
>
--
Konstantin Knizhnik
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
view thread (107+ messages) latest in thread
Message-ID: <f5d50b64-0c83-369e-3a5b-789a93ed0cbe@postgrespro.ru>
Permalink: ../f5d50b64-0c83-369e-3a5b-789a93ed0cbe@postgrespro.ru/
Also on: postgresql.org/message-id/f5d50b64-0c83-369e-3a5b-789a93ed0cbe@postgrespro.ru
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: k.knizhnik@postgrespro.ru
Subject: Re: Cached plans and statement generalization
In-Reply-To: <f5d50b64-0c83-369e-3a5b-789a93ed0cbe@postgrespro.ru>
* 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