Re: Expand applicability of aggregate's sortop optimization

From: Andrei Lepikhov <lepihov(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: David Rowley <dgrowleyml(at)gmail(dot)com>, Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Expand applicability of aggregate's sortop optimization
Date: 2024-10-08 05:47:00
Message-ID: deb2c10a-4a07-4cf1-8ba2-1a0d9c0dcfba@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 10/8/24 08:19, Michael Paquier wrote:
> On Tue, Oct 01, 2024 at 04:25:59PM +0700, Andrei Lepikhov wrote:
>> I have written a sketch patch to implement the idea with aggregate
>> prosupport in code - see the attachment.
>> My intention was to provide an example, not a ready-to-commit patch.
>> As I see, the only problem there lies in the tests - CREATE AGGREGATE
>> doesn't allow us to set a prosupport routine, and we need to update the
>> pg_proc table manually.
>
> Please note that the CF bot is red.
Thanks, I suppose CATALOG_VERSION_NO was the only reason for this fail.

Also, I see that the union test fails:

left join lateral
(select t1.tenthous from tenk2 t2 union all (values(1)))
on true limit 1;
- QUERY PLAN
--------------------------------------------------------------------
- Limit
- -> Nested Loop Left Join
- -> Seq Scan on tenk1 t1
- -> Append
- -> Index Only Scan using tenk2_hundred on tenk2 t2
- -> Result
-(6 rows)
-
+ERROR: deadlock detected
+DETAIL: Process 414506 waits for AccessShareLock on relation 24696 of
database 16387; blocked by process 414511.
+Process 414511 waits for AccessExclusiveLock on relation 16421 of
database 16387; blocked by process 414506.
+HINT: See server log for query details.

But I wonder if new prosupport routine caused that. Please, let me know
if it is not a well-known issue.

--
regards, Andrei Lepikhov

Attachment Content-Type Size
v1-0001-Introduce-prosupport-helpers-for-aggregates.patch text/x-patch 28.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2024-10-08 06:06:31 Re: Expand applicability of aggregate's sortop optimization
Previous Message Shlok Kyal 2024-10-08 05:41:12 Re: long-standing data loss bug in initial sync of logical replication