Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bi6aV-0000VK-CM for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Sep 2016 21:10:23 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bi6aU-0007lS-OJ for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Sep 2016 21:10:22 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bi6Z6-0005hy-7B for pgsql-hackers@postgresql.org; Thu, 08 Sep 2016 21:08:56 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bi6Z2-0006KR-Sk for pgsql-hackers@postgresql.org; Thu, 08 Sep 2016 21:08:54 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u88L8ajG005109; Thu, 8 Sep 2016 17:08:36 -0400 From: Tom Lane To: Alvaro Herrera cc: amborodin@acm.org, Andrew Borodin , Anastasia Lubennikova , Michael Paquier , Amit Kapila , Alexander Korotkov , pgsql-hackers , Oleg Bartunov , Heikki Linnakangas , Sergey Mirvoda Subject: Re: Re: GiST optimizing memmoves in gistplacetopage for fixed-size updates [PoC] In-reply-to: <20160908191312.GA52845@alvherre.pgsql> References: <20160908191312.GA52845@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Thu, 08 Sep 2016 16:13:12 -0300" Date: Thu, 08 Sep 2016 17:08:36 -0400 Message-ID: <5108.1473368916@sss.pgh.pa.us> X-Pg-Spam-Score: -3.0 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Hey Alvaro, can you comment on this bit in the proposed patch? + for (i = FirstOffsetNumber; i <= itemcount; i++) + { + ItemId ii = PageGetItemId(phdr, i); + + /* Normally here was following assertion + * Assert(ItemIdHasStorage(ii)); + * This assertion was introduced in PageIndexTupleDelete + * But if this function will be used from BRIN index + * this assertion will fail. Thus, here we do not check that + * item has the storage. + */ + if (ItemIdGetOffset(ii) <= offset) + ii->lp_off += size_diff; + } + } That comment seems utterly wrong to me, because both PageIndexTupleDelete and PageIndexMultiDelete certainly contain assertions that every item on the page has storage. Are you expecting that any BRIN index items wouldn't? If they wouldn't, is adjusting their lp_off as if they did have storage sensible? regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers