Re: Removing unneeded self joins - Mailing list pgsql-hackers

From Thomas Munro
Subject Re: Removing unneeded self joins
Date
Msg-id CAEepm=19wLyUc4o43j5WnSbYsQPoaErdoOfeXiPP0iB_zRUm_w@mail.gmail.com
Whole thread Raw
In response to Re: Removing unneeded self joins  (Alexander Kuzmenkov <a.kuzmenkov@postgrespro.ru>)
Responses Re: Removing unneeded self joins  (Alexander Kuzmenkov <a.kuzmenkov@postgrespro.ru>)
List pgsql-hackers
On Sat, Jul 28, 2018 at 12:26 AM, Alexander Kuzmenkov
<a.kuzmenkov@postgrespro.ru> wrote:
> Here is a current version of the patch, still rather experimental.

Hi Alexander,

The eval-qual-plan isolation test is failing:

- checking       1050           checking       600
+ checking       600            checking       600

That's the result of a self join with EPQ on one side of the join:

        SELECT * FROM accounts a1, accounts a2
          WHERE a1.accountid = a2.accountid
          FOR UPDATE OF a1;

I think you need to disable the optimisation when there is a locking
clause on one side.  Maybe it could be allowed if it's on both sides?
Not sure.

+ Assert(is_opclause(rinfo->clause));
+ Expr *leftOp = (Expr *) get_leftop(rinfo->clause);

You can't declare a variable here in C89.

-- 
Thomas Munro
http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: [PATCH] Improve geometric types
Next
From: Andrey Borodin
Date:
Subject: Re: Covering GiST indexes