pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <hlinnakangas@vmware.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@postgresql.org
Cc: robert.thaler@cellent.at
Subject: Re: BUG #12292: index row size 1480 exceeds maximum 1352 for index
Date: Mon, 29 Dec 2014 11:38:12 +0200
Message-ID: <54A12104.2090308@vmware.com> (raw)
In-Reply-To: <8172.1419439459@sss.pgh.pa.us>
References: <20141220192730.11502.42806@wrigleys.postgresql.org>
	<8172.1419439459@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

On 12/24/2014 06:44 PM, Tom Lane wrote:
> robert.thaler@cellent.at writes:
>> I tried to upgrade from postgres 9.3.5 and imported a database export
>> created by pg_dump. the import shows the following error:
>> ERROR: index row size 1480 exceeds
>> maximum 1352 for index "idx_sm_post_content"
>
> I've looked into this (thanks to Robert for the test data), and the short
> answer is that commit 36a35c55 approximately halved GinMaxItemSize:
>
>   #define GinMaxItemSize \
> -    MAXALIGN_DOWN(((BLCKSZ - SizeOfPageHeaderData - \
> -        MAXALIGN(sizeof(GinPageOpaqueData))) / 3 - sizeof(ItemIdData)))
> +    Min(INDEX_SIZE_MASK, \
> +        MAXALIGN_DOWN(((BLCKSZ - SizeOfPageHeaderData -                    \
> +                        MAXALIGN(sizeof(GinPageOpaqueData))) / 6 - sizeof(ItemIdData))))
>
> What was the rationale for deciding that GIN has to be able to fit six
> tuples per page???  This is going to create serious dump/reload hazards
> for a lot of users.

Oh. I went to look at the discussions on this patch, and that change was 
present already in the very early versions that were posted around. I 
don't know the reason for that, and I failed to catch it before 
committing; it certainly looks bogus.

I'll revert that, and add a comment above GinMaxItemSize explaining that 
we need to fit at least 3 items on each page. If such a comment had been 
in place, I'm sure someone would've caught this earlier.

Actually, I think we would only need to fit 2 items on each page in GIN. 
In b-tree, we need to fit three: the high key, and two data keys. But in 
the GIN entry tree, we don't store high keys explicitly, we just use the 
rightmost key on the page. That works because we never delete items from 
the entry tree. (I don't dare to change the above to /2, nevertheless)

- Heikki



-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (5+ messages)

Message-ID: <54A12104.2090308@vmware.com>
Permalink:  ../54A12104.2090308@vmware.com/
Also on:    postgresql.org/message-id/54A12104.2090308@vmware.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: hlinnakangas@vmware.com, tgl@sss.pgh.pa.us, robert.thaler@cellent.at
  Subject: Re: BUG #12292: index row size 1480 exceeds maximum 1352 for index
  In-Reply-To: <54A12104.2090308@vmware.com>
  References: <20141220192730.11502.42806@wrigleys.postgresql.org> <8172.1419439459@sss.pgh.pa.us> <54A12104.2090308@vmware.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox