Re: Spilling hashed SetOps and aggregates to disk - Mailing list pgsql-hackers

From Jeff Davis
Subject Re: Spilling hashed SetOps and aggregates to disk
Date
Msg-id 1529611461.3820.55.camel@j-davis.com
Whole thread Raw
In response to Re: Spilling hashed SetOps and aggregates to disk  (David Gershuni <dgershun@cs.cmu.edu>)
Responses Re: Spilling hashed SetOps and aggregates to disk
List pgsql-hackers
On Thu, 2018-06-21 at 11:04 -0700, David Gershuni wrote:
> This approach seems functionally correct, but I don't like the idea
> of
> transforming O(N) tuples of disk I/O into O(S*N) tuples of disk I/O
> (in the worst case).

It's the same amount of I/O as the idea you suggested as putting the
hash tables into separate phases, but it may consume more disk space at
once in the worst case.

We can mitigate that if it becomes a problem later.

> b) is accomplished by not sorting groups by their actual grouping
> keys, but
> instead sorting by their hash values. This works because we don't
> need a 
> true sort. We just need to process identical groups in a consistent
> order
> during the merge step. As long as we're careful about collisions
> during the
> merge, this should work.

Can you expand on how we should handle collisions? If all we can do is
hash and compare equality, then it seems complex to draw group
boundaries.

Regards,
    Jeff Davis



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: PSA: --enable-coverage interferes with parallel query scheduling
Next
From: Alvaro Herrera
Date:
Subject: Re: XML/XPath issues: text/CDATA in XMLTABLE, XPath evaluated withwrong context