Re: Questions regarding distinct operation implementation - Mailing list pgsql-hackers

From Vik Fearing
Subject Re: Questions regarding distinct operation implementation
Date
Msg-id edc608b5-4d42-5329-edbd-139c46fc3fe0@postgresfriends.org
Whole thread Raw
In response to Re: Questions regarding distinct operation implementation  (Ankit Kumar Pandey <itsankitkp@gmail.com>)
Responses Re: Questions regarding distinct operation implementation
List pgsql-hackers
On 12/4/22 14:34, Ankit Kumar Pandey wrote:
> 
> On 04/12/22 02:27, David Rowley wrote:
>>
> 
>> If you were to limit this to only working with the query you mentioned
>> in [1], i.e PARTITION BY without an ORDER BY, then you only need to
>> aggregate once per partition per aggregate and you only need to do
>> that once all of the tuples for the partition are in the tuplestore.
>> It seems to me like you could add all the records to a tuplesort and
>> then sort by the DISTINCT column then aggregate everything except for
>> consecutive duplicates. You can then aggregate any other aggregates
>> which share the same DISTINCT column, otherwise, you just destroy the
>> tuplesort and rinse and repeat for the next aggregate.
 >
> This looks like way to go that would ensure main use case of portability 
> from Oracle.

The goal should not be portability from Oracle, but adherence to the 
standard.
-- 
Vik Fearing




pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: Error-safe user functions
Next
From: Vik Fearing
Date:
Subject: Re: Error-safe user functions