Re: hashagg slowdown due to spill changes - Mailing list pgsql-hackers

From Jeff Davis
Subject Re: hashagg slowdown due to spill changes
Date
Msg-id a2fb7dfeb4f50aa0a123e42151ee3013933cb802.camel@j-davis.com
Whole thread Raw
In response to Re: hashagg slowdown due to spill changes  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: hashagg slowdown due to spill changes
Re: hashagg slowdown due to spill changes
List pgsql-hackers
On Mon, 2020-06-15 at 11:19 -0400, Robert Haas wrote:
> On Mon, Jun 15, 2020 at 9:34 AM Tomas Vondra
> <tomas.vondra@2ndquadrant.com> wrote:
> > But just reverting 4cad2534d will make this much worse, I think, as
> > illustrated by the benchmarks I did in [1].
> 
> I share this concern, although I do not know what we should do about
> it.

I attached an updated version of Melanie's patch, combined with the
changes to copy only the necessary attributes to a new slot before
spilling. There are a couple changes:

* I didn't see a reason to descend into a GroupingFunc node, so I
removed that.

* I used a flag in the context rather than two separate callbacks to
the expression walker.

This patch gives the space benefits that we see on master, without the
regression for small numbers of tuples. I saw a little bit of noise in
my test results, but I'm pretty sure it's a win all around. It could
use some review/cleanup though.

Regards,
    Jeff Davis


Attachment

pgsql-hackers by date:

Previous
From: Ranier Vilela
Date:
Subject: Re: Failures with wal_consistency_checking and 13~
Next
From: Ranier Vilela
Date:
Subject: Re: Postgresql13_beta1 (could not rename temporary statistics file)Windows 64bits