pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Gierth <andrew@tao11.riddles.org.uk>
To: Andreas Karlsson <andreas@proxel.se>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: Ignored join clause
Date: Thu, 19 Apr 2018 03:50:52 +0100
Message-ID: <87muy0dk4a.fsf@news-spur.riddles.org.uk> (raw)
In-Reply-To: <f8128b11-c5bf-3539-48cd-234178b2314d@proxel.se>
References: <f8128b11-c5bf-3539-48cd-234178b2314d@proxel.se>

>>>>> "Andreas" == Andreas Karlsson <andreas@proxel.se> writes:

 Andreas> Hi,
 
 Andreas> It seems to me like PostgreSQL incorrectly removes a join
 Andreas> clause when planning some queries. I discovered this while
 Andreas> debugging a large query, which I below have simplified as much
 Andreas> as I could. I suspect the bug may be related to the lateral
 Andreas> join but I am not sure.

Fascinating.

What's happening here is not that the condition is being ignored, but
rather that what should be a simple filter condition (or a join filter
at the upper level) is being placed in the "Join Filter" slot of an
outer join at the inner level - where the condition's falsity doesn't
remove the whole row but causes it to be treated as unmatched.

My suspicion is that this is an interaction between lateral and join
reordering. Looking into it further.

-- 
Andrew (irc:RhodiumToad)




view thread (7+ messages)  latest in thread

Message-ID: <87muy0dk4a.fsf@news-spur.riddles.org.uk>
Permalink:  ../87muy0dk4a.fsf@news-spur.riddles.org.uk/
Also on:    postgresql.org/message-id/87muy0dk4a.fsf@news-spur.riddles.org.uk

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: andrew@tao11.riddles.org.uk, andreas@proxel.se
  Subject: Re: Ignored join clause
  In-Reply-To: <87muy0dk4a.fsf@news-spur.riddles.org.uk>
  References: <f8128b11-c5bf-3539-48cd-234178b2314d@proxel.se> <87muy0dk4a.fsf@news-spur.riddles.org.uk>

* 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