Re: Window function optimisation, allow pushdowns of items matching PARTITION BY clauses - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Window function optimisation, allow pushdowns of items matching PARTITION BY clauses
Date
Msg-id 32204.1397403101@sss.pgh.pa.us
Whole thread Raw
In response to Window function optimisation, allow pushdowns of items matching PARTITION BY clauses  (David Rowley <dgrowley@gmail.com>)
Responses Re: Window function optimisation, allow pushdowns of items matching PARTITION BY clauses
List pgsql-hackers
David Rowley <dgrowley@gmail.com> writes:
> On this thread
> http://www.postgresql.org/message-id/52C6F712.6040804@student.kit.edu there
> was some discussion around allowing push downs of quals that happen to be
> in every window clause of the sub query. I've quickly put together a patch
> which does this (see attached)

I think you should have check_output_expressions deal with this, instead.
Compare the existing test there for non-DISTINCT output columns.

> Oh and I know that my function var_exists_in_all_query_partition_by_clauses
> has no business in allpaths.c, I'll move it out as soon as I find a better
> home for it.

I might be wrong, but I think you could just embed that search loop in
check_output_expressions, and it wouldn't be too ugly.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Patch to fix a couple of compiler warnings from 80a5cf64
Next
From: Andres Freund
Date:
Subject: Re: Signaling of waiting for a cleanup lock?