Re: Use virtual tuple slot for Unique node - Mailing list pgsql-hackers

From David Rowley
Subject Re: Use virtual tuple slot for Unique node
Date
Msg-id CAApHDvo1D1++JsxPbzA5kpsesZD8vv=DPk=OBAjVUpoAYyaW0w@mail.gmail.com
Whole thread Raw
In response to Use virtual tuple slot for Unique node  (Денис Смирнов <darthunix@gmail.com>)
Responses Re: Use virtual tuple slot for Unique node
List pgsql-hackers
On Thu, 31 Aug 2023 at 05:37, Денис Смирнов <darthunix@gmail.com> wrote:
> I have inspected the performance of the GROUP BY and DISTINCT queries for the sorted data streams and found out, that
Groupnode (produced by GROUP BY) works faster then the Unique node (produced by DISTINCT).  The flame graph should out
thereason - Unique palloc`s tuples for the result slot while the Group node doesn’t. 
>
> I wonder, why do we use minimal tuples for the Unique node instead of the virtual ones? It looks like there is no
actualreason for that as Unique doesn’t make any materialization. 

It would be good to see example queries and a demonstration of the
performance increase. I'm not disputing your claims, but showing some
performance numbers might catch the eye of a reviewer more quickly.

You should also add this to the September commitfest at
https://commitfest.postgresql.org/44/

David



pgsql-hackers by date:

Previous
From: Nathan Bossart
Date:
Subject: Re: pg_stat_get_backend_subxact() and backend IDs?
Next
From: Andres Freund
Date:
Subject: Re: Query execution in Perl TAP tests needs work