Re: Optimizer Doesn't Push Down Where Expressions on Rollups

From: Richard Guo <guofenglinux(at)gmail(dot)com>
To: logan(dot)bowers(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: Optimizer Doesn't Push Down Where Expressions on Rollups
Date: 2020-03-11 08:59:26
Message-ID: CAMbWs49zx2WFAzWGsay-X8PLdwboujtGsjSydJtsHa9xbAKHiA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

In your case, the WHERE clauses would get pushed down into the subquery
for both queries, with/without the ROLLUP. But since the subquery uses
grouping/grouping sets, the WHERE clauses would be put in HAVING of the
subquery.

Then when we plan for the subquery, we will decide whether a HAVING
clause can be transfered into WHERE. Usually we do not do that if there
are any nonempty grouping sets. Because if any referenced column isn't
present in all the grouping sets, moving such a clause into WHERE would
potentially change the results.

Thanks
Richard

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2020-03-11 09:01:19 BUG #16296: broken /etc/yum.repos.d/pgdg-redhat-all.repo
Previous Message PG Bug reporting form 2020-03-11 02:21:47 BUG #16295: parsing error in pgdg-centos10-10-2.noarch.rpm/pgdg-redhat-all.repo

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2020-03-11 09:01:59 Re: Improve search for missing parent downlinks in amcheck
Previous Message Amit Kapila 2020-03-11 08:53:12 Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager