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

Andres Freund <andres@anarazel.de>

From: Andres Freund <andres@anarazel.de>
To: "Todd A. Cook" <tcook@blackducksoftware.com>
Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>, pgsql-bugs@postgresql.org
Date: 2017-11-27T22:10:42Z
Lists: pgsql-bugs
Hi,

On 2017-11-27 15:59:37 -0500, Todd A. Cook wrote:
> COPY reproducer (val) FROM stdin;
> 2976219712004784288
> -6429122065899879392
> -7471109962990387136
> -7471109962990387136
> -2895470491222113184
> -4083509061952565472
> 1019481548263425664
> 4639248884787347648
> -6999443831165647744
> -4199917803455020480
> -4110530183001439680

How are these values generated? They awfully look like hash values
(~same lenght, full numerical range)...

I'm kinda neck deep in something else, but I'll try to have a look
afterwards.

Greetings,

Andres Freund


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.