Re: DBT-3 with SF=20 got failed

From: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: DBT-3 with SF=20 got failed
Date: 2015-06-11 15:12:21
Message-ID: 5579A555.1060604@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 06/11/15 16:54, Tom Lane wrote:
> Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dave Page 2015-06-11 15:13:54 Re: The purpose of the core team
Previous Message Bruce Momjian 2015-06-11 15:11:48 Re: 9.5 release notes