Re: review: More frame options in window functions - Mailing list pgsql-hackers

From Tom Lane
Subject Re: review: More frame options in window functions
Date
Msg-id 7170.1263682169@sss.pgh.pa.us
Whole thread Raw
In response to Re: review: More frame options in window functions  (Hitoshi Harada <umi.tanuki@gmail.com>)
Responses Re: review: More frame options in window functions  (Hitoshi Harada <umi.tanuki@gmail.com>)
List pgsql-hackers
Hitoshi Harada <umi.tanuki@gmail.com> writes:
> ... I tried to change not to canonicalize the
> pathkeys in make_pathkeys_window() in such cases and succeeded then
> passed all regression tests.

That's broken, whether it passes regression tests or not.  Not
canonicalizing will mean that you fail to recognize equality to
canonicalized pathkeys, and thus for example execute unnecessary
sorts.

I haven't looked at the patch, but it sounds a bit like you are trying
to put logic into the executor that needs to be in the planner.  If the
executor is guessing about what the planner did, that's a design
failure.  The planner should figure out what needs to happen and tell
the executor exactly what to do, eg, which columns need to be compared
to determine partition membership.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Hitoshi Harada
Date:
Subject: Re: review: More frame options in window functions
Next
From: Robert Haas
Date:
Subject: Re: Partitioning syntax