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: Tom Lane <tgl@sss.pgh.pa.us>, Tomas Vondra <tomas.vondra@2ndquadrant.com>, Thomas Munro <thomas.munro@enterprisedb.com>, PostgreSQL Bugs <pgsql-bugs@postgresql.org>
Date: 2018-01-29T18:31:18Z
Lists: pgsql-bugs

Attachments

On 2018-01-29 13:20:25 -0500, Todd A. Cook wrote:
> I applied 0001 and 0002 to REL_10_STABLE at 1b2a3860d3ea81825e9bbad2c7dbf66db87445c1
> and got the following build error:
> 
> 	execGrouping.c:26:29: fatal error: utils/hashutils.h: No such file or directory
> 	 #include "utils/hashutils.h"

Yea, there's some minor differences from master to the 10 branch,
needing to backport one commit beforehand. Attached are three patches
applying to 10.

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.