public inbox for [email protected]  
help / color / mirror / Atom feed
From: Ankit Kumar Pandey <[email protected]>
To: David Rowley <[email protected]>
Cc: Vik Fearing <[email protected]>
Cc: pghackers <[email protected]>
Subject: Re: Todo: Teach planner to evaluate multiple windows in the optimal order
Date: Thu, 5 Jan 2023 13:16:15 +0530
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAApHDvruS-3gG_KYXPb_=Um_TfUXi+G4o7VyBVbChTjThXF2yA@mail.gmail.com>
References: <[email protected]>
	<CAApHDvp=r1LnEKCmWCYaruMPL-jP4j_sdc8yeFYwaDT1ac5GsQ@mail.gmail.com>
	<[email protected]>
	<CAApHDvq=g2=ny59f1bvwRVvupsgPHK-KjLPBsSL25fVuGZ4idQ@mail.gmail.com>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<CAApHDvruS-3gG_KYXPb_=Um_TfUXi+G4o7VyBVbChTjThXF2yA@mail.gmail.com>


On 05/01/23 12:53, David Rowley wrote:
>
> We *can* reuse Sorts where a more strict or equivalent sort order is
> available.  The question is how do we get the final WindowClause to do
> something slightly more strict to save having to do anything for the
> ORDER BY.  One way you might think would be to adjust the
> WindowClause's orderClause to add the additional clauses, but that
> cannot be done because that would cause are_peers() in nodeWindowAgg.c
> to not count some rows as peers when they maybe should be given a less
> strict orderClause in the WindowClause.
Okay, now I see issue in my approach.
> It might be possible to adjust create_one_window_path() so that when
> processing the final WindowClause that it looks at the DISTINCT or
> ORDER BY clause to see if we can sort on a few extra columns to save
> having to do any further sorting.  We just *cannot* make any
> adjustments to the WindowClause's orderClause.
>
This is much better solution. I will check

create_one_window_path for the same.

-- 
Regards,
Ankit Kumar Pandey







view thread (60+ messages)  latest in thread

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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Todo: Teach planner to evaluate multiple windows in the optimal order
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox