Re: DBT-3 with SF=20 got failed

From: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
To: Kohei KaiGai <kaigai(at)kaigai(dot)gr(dot)jp>
Cc: Robert Haas <robertmhaas(at)gmail(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: DBT-3 with SF=20 got failed
Date: 2015-08-19 10:35:03
Message-ID: CAKJS1f9V2QNLkoT5qEXbm+Ch+SeL=JaDynTcmzPsb+fxCf+=dw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 12 June 2015 at 02:40, Kohei KaiGai <kaigai(at)kaigai(dot)gr(dot)jp> wrote:

> 2015-06-11 23:28 GMT+09:00 Robert Haas <robertmhaas(at)gmail(dot)com>:
> > On Wed, Jun 10, 2015 at 10:57 PM, Kouhei Kaigai <kaigai(at)ak(dot)jp(dot)nec(dot)com>
> wrote:
> >> The attached patch replaces this palloc0() by MemoryContextAllocHuge()
> + memset().
> >> Indeed, this hash table is constructed towards the relation with
> nrows=119994544,
> >> so, it is not strange even if hash-slot itself is larger than 1GB.
> >
> > You forgot to attach the patch, I think.
> >
> Oops, I forgot to attach indeed.
>
> > It looks to me like the size
> > of a HashJoinTuple is going to be 16 bytes, so 1GB/16 = ~64 million.
> > That's a lot of buckets, but maybe not unreasonably many if you've got
> > enough memory.
> >
> EXPLAIN says, this Hash node takes underlying SeqScan with
> 119994544 (~119 million) rows, but it is much smaller than my
> work_mem setting.
>
>
I've just run into this problem while running a TPC-H benchmark of 100GB,
on a machine with 64GB of RAM.
When attempting to run Q21 with a work_mem of 10GB I'm getting:
ERROR: invalid memory alloc request size 1073741824

Setting work_mem to 1GB or less gets the query running.

I've patched the code with your patch Kohei, and it's now working.

Thought I'd better post this just in case this gets forgotten about.

Thanks

David

--
David Rowley http://www.2ndQuadrant.com/
<http://www.2ndquadrant.com/>
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2015-08-19 11:12:34 Re: DBT-3 with SF=20 got failed
Previous Message Albe Laurenz 2015-08-19 09:21:50 Re: Proposal: Implement failover on libpq connect level.