Re: Add ExprState hashing for GROUP BY and hashed SubPlans

From: Andrei Lepikhov <lepihov(at)gmail(dot)com>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Add ExprState hashing for GROUP BY and hashed SubPlans
Date: 2024-11-02 09:13:16
Message-ID: 7bbc5ff9-33c3-4410-923a-2b4c6bc62447@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 11/1/24 06:17, David Rowley wrote:
> On Thu, 31 Oct 2024 at 15:30, Andrei Lepikhov <lepihov(at)gmail(dot)com> wrote:
>> Comparing the master with and without your patch, the first, I see is
>> more extensive usage of memory (see complete explains in the attachment):
>>
>> Current master:
>> Batches: 1 Memory Usage: 74513kB
>
>> Patched:
>> Batches: 261 Memory Usage: 527905kB Disk Usage: 4832656kB
>
> Thanks for testing that. I had forgotten to adjust the storage
> location for the hash initial value when I rebased the patch against
> the changes made in 9ca67658d. I've fixed that in the attached patch.
Okay, I passed through the code. It looks good. Hashing expressions are
too simple to give notably impressive results, but it is a step in the
right direction.
I found only one minor issue: an outdated comment (see attachment).
Also, to make a hash calculation as fast as possible, should we add the
call of murmurhash32 as an optional step of ExprState in the
ExecBuildHash32FromAttrs?

--
regards, Andrei Lepikhov

Attachment Content-Type Size
comment_fix.diff text/x-patch 871 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nitin Jadhav 2024-11-02 11:04:27 Re: Count and log pages set all-frozen by vacuum
Previous Message Andrey M. Borodin 2024-11-02 08:37:26 Re: What is a typical precision of gettimeofday()?