Re: DBT-3 with SF=20 got failed - Mailing list pgsql-hackers

From Tomas Vondra
Subject Re: DBT-3 with SF=20 got failed
Date
Msg-id 5579A555.1060604@2ndquadrant.com
Whole thread Raw
In response to Re: DBT-3 with SF=20 got failed  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers

On 06/11/15 16:54, Tom Lane wrote:
> Tomas Vondra <tomas.vondra@2ndquadrant.com> writes:
>> Interestingly, the hash code checks for INT_MAX overflows on a number of
>> places, but does not check for this ...
>
> Yeah, and at least at one time there were checks to prevent the hash
> table request from exceeding MaxAllocSize. Did those get removed by
> somebody?

I think the problem is in this piece of code:
  if ((hashtable->nbatch == 1) &&      (hashtable->nbuckets_optimal <= INT_MAX / 2) &&       /* overflow protection */
   (ntuples >= (hashtable->nbuckets_optimal * NTUP_PER_BUCKET)))      {          hashtable->nbuckets_optimal *= 2;
   hashtable->log2_nbuckets_optimal += 1;      }
 

ISTM it does not check against the max_pointers (that's only done in 
ExecChooseHashTableSize).



--
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: 9.5 release notes
Next
From: Dave Page
Date:
Subject: Re: The purpose of the core team