Re: Bug? ExecChooseHashTableSize() got assertion failed with crazy number of rows

From: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Kevin Grittner <kgrittn(at)ymail(dot)com>, Kouhei Kaigai <kaigai(at)ak(dot)jp(dot)nec(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Bug? ExecChooseHashTableSize() got assertion failed with crazy number of rows
Date: 2015-08-19 01:07:16
Message-ID: CAKJS1f-BC6kEDaigPLXrg4-JAXvTE8z4ooQj26vaQnqh+tA8pw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 19 August 2015 at 12:38, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> David Rowley <david(dot)rowley(at)2ndquadrant(dot)com> writes:
> > david=# set work_mem = '94GB';
> > ERROR: 98566144 is outside the valid range for parameter "work_mem" (64
> ..
> > 2097151)
>
> Apparently you're testing on a 32-bit server. 64-bit servers allow
> work_mem to go up to INT_MAX kilobytes.
>

hmm, no, but it does appear that sizeof(long) is 4 bytes for me, despite 64
bit OS.

I guess this accounts for my misunderstanding that work_mem was limited to
2GB even on 64 bit machines.

From guc.h

#if SIZEOF_SIZE_T > 4 && SIZEOF_LONG > 4
#define MAX_KILOBYTES INT_MAX
#else
#define MAX_KILOBYTES (INT_MAX / 1024)
#endif

Apologies for the noise.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2015-08-19 01:38:15 Re: allowing wal_level change at run time
Previous Message Kouhei Kaigai 2015-08-19 00:59:40 Re: Our trial to TPC-DS but optimizer made unreasonable plan