Use virtual tuple slot for Unique node

From: Денис Смирнов <darthunix(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Use virtual tuple slot for Unique node
Date: 2023-08-30 16:32:02
Message-ID: 388BA879-CAEC-4930-A4EE-F06DC1F12C96@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I have inspected the performance of the GROUP BY and DISTINCT queries for the sorted data streams and found out, that Group node (produced by GROUP BY) works faster then the Unique node (produced by DISTINCT). The flame graph should out the reason - 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 actual reason for that as Unique doesn’t make any materialization.

Attachment Content-Type Size
v1-use-virtual-slots-for-unique-node.txt text/plain 592 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Verite 2023-08-30 16:40:45 Re: EBCDIC sorting as a use case for ICU rules
Previous Message Alvaro Herrera 2023-08-30 16:28:36 Re: More new SQL/JSON item methods