Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eCTkm-0001JL-Et for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Nov 2017 17:03:04 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1eCTkm-0007ya-1c for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Nov 2017 17:03:04 +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 1eCTkl-0007yO-D0 for pgsql-hackers@postgresql.org; Wed, 08 Nov 2017 17:03:03 +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 1eCTkf-0004No-66 for pgsql-hackers@postgresql.org; Wed, 08 Nov 2017 17:03:02 +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 vA8H2eLV022997; Wed, 8 Nov 2017 12:02:40 -0500 From: Tom Lane To: Claudio Freire cc: Robert Haas , Andres Freund , =?UTF-8?B?0K7RgNC40Lkg0KHQvtC60L7Qu9C+0LI=?= , Sokolov Yura , Alvaro Herrera , Heikki Linnakangas , PostgreSQL-Dev Subject: Re: Small improvement to compactify_tuples In-reply-to: References: <20171107152004.axgznk3n5tkzvnnt@alap3.anarazel.de> <29007.1510090796@sss.pgh.pa.us> <19570.1510155199@sss.pgh.pa.us> Comments: In-reply-to Claudio Freire message dated "Wed, 08 Nov 2017 13:29:15 -0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <22995.1510160560.1@sss.pgh.pa.us> Date: Wed, 08 Nov 2017 12:02:40 -0500 Message-ID: <22996.1510160560@sss.pgh.pa.us> 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 Claudio Freire writes: > What's perhaps not clear is whether there are better ideas. Like > rebuilding the page as Tom proposes, which doesn't seem like a bad > idea. Bucket sort already is O(bytes), just as memcopy, only it has a > lower constant factor (it's bytes/256 in the original patch), which > might make copying the whole page an extra time lose against bucket > sort in a few cases. > Deciding that last point does need more benchmarking. That doesn't > mean the other improvements can't be pursued in the meanwhile, right? Well, I doubt we're going to end up committing more than one of these ideas. The question is which way is best. If people are willing to put in the work to test all of them, let's do it. BTW, it strikes me that in considering the rebuild-the-page approach, we should not have blinders on and just measure the speed of PageRepairFragmentation. Rather, we should take a look at what happens subsequently given a physically-ordered set of tuples. I can recall Andres or someone moaning awhile ago about lack of locality of access in index page searches --- maybe applying that approach while vacuuming indexes will help? 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