Re: BUG #14051: GIN index creation fails with large number of duplicate keys

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: David Gould <daveg(at)sonic(dot)net>
Cc: Pg Bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #14051: GIN index creation fails with large number of duplicate keys
Date: 2016-03-30 22:18:01
Message-ID: CAMkU=1z2JZvXFjBtFRjYdRhj2RjnO3M2w81zZ7EmemZ+0HeD0w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, Mar 29, 2016 at 4:50 AM, <daveg(at)sonic(dot)net> wrote:
> The following bug has been logged on the website:
>
> Bug reference: 14051
> Logged by: David Gould
> Email address: daveg(at)sonic(dot)net
> PostgreSQL version: 9.4.6
> Operating system: Linux
> Description:
>
> Creating a GIN index that contains a large number of duplicate keys fails.
>
> create table ginfail as
> select i::int, array[1::int] as manydups
> from generate_series(1, 180000000) x(i);
> SELECT 180000000
>
> create index ginfail_gin on ginfail using gin(manydups);
> ERROR: invalid memory alloc request size 2013265920
>
...

>
> The problem appears to be that the repalloc() of eo->list to double the size
> of the allocation runs over MaxAllocSize. Perhaps it could use
> repalloc_huge() instead?

In 9.6, that is what it does (commit
30bb26b5e04cff911db960801e32e5f57045eb61). But I don't think there
are any plans to back-port it to 9.4 and 9.5.

Although it looks like it should be pretty easy to do that back-patching.

Cheers,

Jeff

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Noah Misch 2016-03-31 05:22:20 Re: Breakage with VACUUM ANALYSE + partitions
Previous Message clitre 2016-03-30 17:47:03 BUG #14055: The link to download windows version is not working