Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f9BMg-0004nv-5W for pgsql-bugs@arkaria.postgresql.org; Thu, 19 Apr 2018 15:20:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f9BMf-0005Tm-2I for pgsql-bugs@arkaria.postgresql.org; Thu, 19 Apr 2018 15:20:49 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f9BMe-0005Tc-SR for pgsql-bugs@lists.postgresql.org; Thu, 19 Apr 2018 15:20:48 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f9BMX-0003HG-QT for pgsql-bugs@lists.postgresql.org; Thu, 19 Apr 2018 15:20:48 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w3JFKd9g021506; Thu, 19 Apr 2018 11:20:39 -0400 From: Tom Lane To: Andrew Gierth cc: Andreas Karlsson , pgsql-bugs@lists.postgresql.org Subject: Re: Ignored join clause In-reply-to: <21075.1524150692@sss.pgh.pa.us> References: <87muy0dk4a.fsf@news-spur.riddles.org.uk> <87efjbe8rz.fsf@news-spur.riddles.org.uk> <21075.1524150692@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Thu, 19 Apr 2018 11:11:32 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <21504.1524151239.1@sss.pgh.pa.us> Date: Thu, 19 Apr 2018 11:20:39 -0400 Message-ID: <21505.1524151239@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I wrote: > I've not got to the bottom of it yet either, but I notice that if you > replace the VALUES thingy with a plain table, the bug goes away: Oh, scratch that --- if you "ANALYZE q1", it goes right back to the bogus plan. So knowing that q1 is small is part of the triggering condition for picking the bogus plan, but VALUES per se isn't. regards, tom lane