Re: WIP: Enhanced ALTER OPERATOR

From: Andres Freund <andres(at)anarazel(dot)de>
To: Uriy Zhuravlev <u(dot)zhuravlev(at)postgrespro(dot)ru>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: WIP: Enhanced ALTER OPERATOR
Date: 2015-05-20 18:50:41
Message-ID: 20150520185041.GJ27868@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2015-05-20 12:22:34 +0300, Uriy Zhuravlev wrote:
> On Monday 18 May 2015 10:21:10 you wrote:
> > difficulty of updating existing cached plans
> Could you specify more precisely about some caches we talking about? PREPARE
> working correctly:
>
> CREATE TABLE test_ints(i int4);
> CREATE TABLE
> CREATE INDEX idx ON test_ints(i);
> CREATE INDEX
> set enable_bitmapscan=off;
> SET
> set enable_seqscan=off;
> SET
> PREPARE test_plan (int) AS
> SELECT * FROM test_ints WHERE $1::int4 > i;
> PREPARE
> EXPLAIN (COSTS OFF)
> EXECUTE test_plan(5);
> QUERY PLAN
> ----------------------------------------
> Index Only Scan using idx on test_ints
> Index Cond: (i < 5)
>
> ALTER OPERATOR > (int4, int4) SET COMMUTATOR NONE;
> ALTER OPERATOR
> EXPLAIN (COSTS OFF)
> EXECUTE test_plan(5);
> QUERY PLAN
> ----------------------------------------
> Index Only Scan using idx on test_ints
> Filter: (5 > i)

Note that this very likely wasn't actually using a prepared plan. Due to
the custom plan infrastructure the first few invocations are going to be
replanned.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruno Harbulot 2015-05-20 18:52:07 Re: Problems with question marks in operators (JDBC, ECPG, ...)
Previous Message Tom Lane 2015-05-20 18:44:14 Re: WIP: Enhanced ALTER OPERATOR