Re: Spilling hashed SetOps and aggregates to disk

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Spilling hashed SetOps and aggregates to disk
Date: 2018-06-05 05:18:56
Message-ID: 1528175936.2742.8.camel@j-davis.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, 2018-06-04 at 11:52 -0700, Andres Freund wrote:
> I wonder whether, at least for aggregates, the better fix wouldn't be
> to
> switch to feeding the tuples into tuplesort upon memory exhaustion
> and
> doing a sort based aggregate.  We have most of the infrastructure to
> do

That's an interesting idea, but it seems simpler to stick to hashing
rather than using a combination strategy. It also seems like it would
take less CPU effort.

What advantages do you have in mind? My patch partitions the spilled
data, so it should have similar disk costs as a sort approach.

Regards,
Jeff Davis

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2018-06-05 05:26:08 Re: libpq compression
Previous Message Tomas Vondra 2018-06-05 05:04:04 Re: Spilling hashed SetOps and aggregates to disk