pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Gierth <andrew@tao11.riddles.org.uk>
To: Rob Nikander <rob.nikander@gmail.com>
Cc: Postgres General <pgsql-general@postgresql.org>
Subject: Re: query patterns for multipass aggregating
Date: Sun, 11 Nov 2018 17:54:21 +0000
Message-ID: <878t1zwlh8.fsf@news-spur.riddles.org.uk> (raw)
In-Reply-To: <87d0rbwp4a.fsf@news-spur.riddles.org.uk>
References: <11335409-A083-4951-BC7A-3C4FD118AC04@gmail.com>
	<87d0rbwp4a.fsf@news-spur.riddles.org.uk>

>>>>> "Andrew" == Andrew Gierth <andrew@tao11.riddles.org.uk> writes:

 Andrew> Unfortunately, the planner isn't smart enough yet to know that
 Andrew> these two are equivalent,

oops, I edited the second one before posting in a way that made them not
be equivalent: adding a "group by x0.item_id" in both subqueries in
method 2 makes them equivalent again. Without that, the result differs
slightly if there are no matching color or image rows (NULL vs. empty
array).

-- 
Andrew (irc:RhodiumToad)




view thread (6+ messages)  latest in thread

Message-ID: <878t1zwlh8.fsf@news-spur.riddles.org.uk>
Permalink:  ../878t1zwlh8.fsf@news-spur.riddles.org.uk/
Also on:    postgresql.org/message-id/878t1zwlh8.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-general@postgresql.org
  Cc: andrew@tao11.riddles.org.uk, rob.nikander@gmail.com
  Subject: Re: query patterns for multipass aggregating
  In-Reply-To: <878t1zwlh8.fsf@news-spur.riddles.org.uk>
  References: <11335409-A083-4951-BC7A-3C4FD118AC04@gmail.com> <87d0rbwp4a.fsf@news-spur.riddles.org.uk> <878t1zwlh8.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