Re: query patterns for multipass aggregating

From: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
To: Rob Nikander <rob(dot)nikander(at)gmail(dot)com>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: query patterns for multipass aggregating
Date: 2018-11-11 17:54:21
Message-ID: 878t1zwlh8.fsf@news-spur.riddles.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>>>>> "Andrew" == Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)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)

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rob Nikander 2018-11-11 18:23:18 Re: query patterns for multipass aggregating
Previous Message Andrew Gierth 2018-11-11 17:41:49 Re: query patterns for multipass aggregating