Distinct tightly coupled with Agg

Started by Ankit Kumar Pandeyabout 3 years ago3 messages
#1Ankit Kumar Pandey
itsankitkp@gmail.com

Hello,

I am looking at todo item (#1) /Implement DISTINCT clause in window
aggregates/ and while looking at code, I found distinct tightly coupled
with Agg function. Looking at another todo item(#2) /Do we really need
so much duplicated code between Agg and WindowAgg/?  I was wondering
what is general stance on this? Is #2 per-requisite for #1?

If that is not case, I assume making distinct a standalone piece should
be an option too?

Would be glad if someone should shed light on this. Thanks.

Regards,
Ankit

#2Ankit Kumar Pandey
itsankitkp@gmail.com
In reply to: Ankit Kumar Pandey (#1)
Re: Distinct tightly coupled with Agg

On 16/11/22 00:26, Tom Lane wrote:

Ankit Kumar Pandey <itsankitkp@gmail.com> writes:

I am looking at todo item (#1) /Implement DISTINCT clause in window
aggregates/ and while looking at code, I found distinct tightly coupled
with Agg function. Looking at another todo item(#2) /Do we really need
so much duplicated code between Agg and WindowAgg/?  I was wondering
what is general stance on this? Is #2 per-requisite for #1?

No, I think #2 is just a general statement of annoyance. It'd be
great if someone finds a way to refactor things to improve that; but
seeing that window functions operate in a much different environment
than plain aggregates, I'm not holding my breath. It's certainly
not a prerequisite for any other work in the area.

regards, tom lane

Makes sense, thank you.

Regards,

Ankit

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Ankit Kumar Pandey (#1)
Re: Distinct tightly coupled with Agg

Ankit Kumar Pandey <itsankitkp@gmail.com> writes:

I am looking at todo item (#1) /Implement DISTINCT clause in window
aggregates/ and while looking at code, I found distinct tightly coupled
with Agg function. Looking at another todo item(#2) /Do we really need
so much duplicated code between Agg and WindowAgg/?  I was wondering
what is general stance on this? Is #2 per-requisite for #1?

No, I think #2 is just a general statement of annoyance. It'd be
great if someone finds a way to refactor things to improve that; but
seeing that window functions operate in a much different environment
than plain aggregates, I'm not holding my breath. It's certainly
not a prerequisite for any other work in the area.

regards, tom lane