Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aL9Kp-0007lm-Ea for pgsql-bugs@arkaria.postgresql.org; Mon, 18 Jan 2016 12:55:03 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aL9Ko-0002Id-Gx for pgsql-bugs@arkaria.postgresql.org; Mon, 18 Jan 2016 12:55:02 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aL9Ko-0002IV-4r for pgsql-bugs@postgresql.org; Mon, 18 Jan 2016 12:55:02 +0000 Received: from lungold.riddles.org.uk ([82.68.208.19]) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1aL9Kk-0001pI-Rb for pgsql-bugs@postgresql.org; Mon, 18 Jan 2016 12:55:00 +0000 Received: from localhost ([127.0.0.1]:18835 helo=caithnard.riddles.org.uk) by lungold.riddles.org.uk with esmtp (Exim 4.84 (FreeBSD)) (envelope-from ) id 1aL9Ke-000AvH-42; Mon, 18 Jan 2016 12:54:52 +0000 From: Andrew Gierth To: Dean Rasheed Cc: Andres Freund , wrb , Haribabu Kommi , "pgsql-bugs\@postgresql.org" Subject: Re: BUG #13863: Select from views gives wrong results In-Reply-To: (Dean Rasheed's message of "Sat, 16 Jan 2016 17:29:30 +0000") Message-ID: <87egdfuk2n.fsf@news-spur.riddles.org.uk> References: <20160113183558.12989.56904@wrigleys.postgresql.org> <82C006C0-07A7-401B-9BDA-0BABD9025099@autistici.org> <20160116131202.GP10941@awork2.anarazel.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) Date: Mon, 18 Jan 2016 12:54:51 +0000 MIME-Version: 1.0 Content-Type: text/plain X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org >>>>> "Dean" == Dean Rasheed writes: > On 16 January 2016 at 13:12, Andres Freund wrote: >> Hm, I'm a bit hesitant to potentially noticeably regress plans here, >> although it seems unikely that already "relies" on this. Can't we >> essentially treat references to columns which can be set to null by >> due to a grouping set, as containing an agg clause and only prevent >> moving in that case? Dean> I suppose it could be done, but it seems like a fair bit of Dean> work. It would be a bit like check_ungrouped_columns() except Dean> that it would only be safe to move the clause if it only referred Dean> to expressions that appeared in the intersection of all the Dean> grouping sets. I think that would rule out most real-world Dean> examples, including just about anything using rollup or cube, so Dean> I'm not sure it would be worth the effort. Obvious question is, can we keep the optimization in the case that the qual is strict? and if so, should we? -- Andrew (irc:RhodiumToad) -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs