Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Y5Wmx-0003su-1G for pgsql-bugs@arkaria.postgresql.org; Mon, 29 Dec 2014 09:38:59 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Y5Wmv-0002Sn-GW for pgsql-bugs@arkaria.postgresql.org; Mon, 29 Dec 2014 09:38:57 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Y5Wmu-0002Sb-O8 for pgsql-bugs@postgresql.org; Mon, 29 Dec 2014 09:38:56 +0000 Received: from smtp-outbound-1.vmware.com ([208.91.2.12]) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1Y5Wmo-0002Ik-Fa for pgsql-bugs@postgresql.org; Mon, 29 Dec 2014 09:38:52 +0000 Received: from sc9-mailhost1.vmware.com (sc9-mailhost1.vmware.com [10.113.161.71]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id 1987328173; Mon, 29 Dec 2014 01:38:48 -0800 (PST) Received: from EX13-CAS-005.vmware.com (EX13-CAS-005.vmware.com [10.113.191.55]) by sc9-mailhost1.vmware.com (Postfix) with ESMTP id 152D9196BC; Mon, 29 Dec 2014 01:38:48 -0800 (PST) Received: from EX13-MBX-024.vmware.com (10.113.191.44) by EX13-MBX-001.vmware.com (10.113.191.21) with Microsoft SMTP Server (TLS) id 15.0.913.22; Mon, 29 Dec 2014 01:38:41 -0800 Received: from [192.168.1.90] (10.113.160.246) by EX13-MBX-024.vmware.com (10.113.191.44) with Microsoft SMTP Server (TLS) id 15.0.913.22; Mon, 29 Dec 2014 01:38:27 -0800 Message-ID: <54A12104.2090308@vmware.com> Date: Mon, 29 Dec 2014 11:38:12 +0200 From: Heikki Linnakangas Organization: VMware User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.3.0 MIME-Version: 1.0 To: Tom Lane CC: , Subject: Re: BUG #12292: index row size 1480 exceeds maximum 1352 for index References: <20141220192730.11502.42806@wrigleys.postgresql.org> <8172.1419439459@sss.pgh.pa.us> In-Reply-To: <8172.1419439459@sss.pgh.pa.us> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.113.160.246] X-ClientProxiedBy: EX13-CAS-013.vmware.com (10.113.191.65) To EX13-MBX-024.vmware.com (10.113.191.44) X-Pg-Spam-Score: -6.9 (------) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org 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