pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Gierth <andrew@tao11.riddles.org.uk>
To: Dean Rasheed <dean.a.rasheed@gmail.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: wrb <wrb@autistici.org>
Cc: Haribabu Kommi <kommi.haribabu@gmail.com>
Cc: pgsql-bugs\@postgresql.org <pgsql-bugs@postgresql.org>
Subject: Re: BUG #13863: Select from views gives wrong results
Date: Mon, 18 Jan 2016 12:54:51 +0000
Message-ID: <87egdfuk2n.fsf@news-spur.riddles.org.uk> (raw)
In-Reply-To: <CAEZATCWK-XDQxn2L1W6Te0LTu5XRUqyEo57kLQyxLJOG1VTrpQ@mail.gmail.com>
References: <20160113183558.12989.56904@wrigleys.postgresql.org>
	<CAJrrPGdmBM9=ttRfT24FOzDySE9dSs1Uw0+ynD5FAo+pFR9Z8w@mail.gmail.com>
	<82C006C0-07A7-401B-9BDA-0BABD9025099@autistici.org>
	<CAEZATCXF3ZdUWkxUSX3CJUdX14yfVf++CW0KSZ1fSjYgFoFSAA@mail.gmail.com>
	<20160116131202.GP10941@awork2.anarazel.de>
	<CAEZATCWK-XDQxn2L1W6Te0LTu5XRUqyEo57kLQyxLJOG1VTrpQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

>>>>> "Dean" == Dean Rasheed <dean.a.rasheed@gmail.com> writes:

 > On 16 January 2016 at 13:12, Andres Freund <andres@anarazel.de> 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



view thread (14+ messages)  latest in thread

Message-ID: <87egdfuk2n.fsf@news-spur.riddles.org.uk>
Permalink:  ../87egdfuk2n.fsf@news-spur.riddles.org.uk/
Also on:    postgresql.org/message-id/87egdfuk2n.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, dean.a.rasheed@gmail.com, andres@anarazel.de, wrb@autistici.org, kommi.haribabu@gmail.com
  Subject: Re: BUG #13863: Select from views gives wrong results
  In-Reply-To: <87egdfuk2n.fsf@news-spur.riddles.org.uk>
  References: <20160113183558.12989.56904@wrigleys.postgresql.org> <CAJrrPGdmBM9=ttRfT24FOzDySE9dSs1Uw0+ynD5FAo+pFR9Z8w@mail.gmail.com> <82C006C0-07A7-401B-9BDA-0BABD9025099@autistici.org> <CAEZATCXF3ZdUWkxUSX3CJUdX14yfVf++CW0KSZ1fSjYgFoFSAA@mail.gmail.com> <20160116131202.GP10941@awork2.anarazel.de> <CAEZATCWK-XDQxn2L1W6Te0LTu5XRUqyEo57kLQyxLJOG1VTrpQ@mail.gmail.com> <87egdfuk2n.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