Re: BUG #14932: SELECT DISTINCT val FROM table gets stuck in an infinite loop

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>, "Todd A. Cook" <tcook@blackducksoftware.com>, Thomas Munro <thomas.munro@enterprisedb.com>, PostgreSQL Bugs <pgsql-bugs@postgresql.org>
Date: 2018-01-26T23:48:35Z
Lists: pgsql-bugs
Andres Freund <andres@anarazel.de> writes:
> On 2017-12-10 23:09:42 +0100, Tomas Vondra wrote:
>> FWIW I do agree the data sets shared in this thread are pretty extreme
>> and it doesn't make much sense to slow the regular cases. I'll be
>> perfectly happy if we stop the OOM, making those cases fast is a bonus.

> Yea, agreed on that. I'm kinda inclined to go for stop-growing in 10,
> and so something better in 11. And then later possibly backpatch if
> we've grown some confidence?

+1.  I'd like to see some response to this included in 10.2, and time
grows short for that.

			regards, tom lane


Commits

  1. Improve bit perturbation in TupleHashTableHash.

  2. Prevent growth of simplehash tables when they're "too empty".

  3. Add stack-overflow guards in set-operation planning.