Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h7HQ4-0006Zn-2U for pgsql-hackers@arkaria.postgresql.org; Fri, 22 Mar 2019 10:29:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h7HQ2-0008FE-RL for pgsql-hackers@arkaria.postgresql.org; Fri, 22 Mar 2019 10:28:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h7HQ2-0008Ew-JR for pgsql-hackers@lists.postgresql.org; Fri, 22 Mar 2019 10:28:58 +0000 Received: from mail-lj1-f181.google.com ([209.85.208.181]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h7HQ0-0001j0-FB for pgsql-hackers@postgresql.org; Fri, 22 Mar 2019 10:28:58 +0000 Received: by mail-lj1-f181.google.com with SMTP id z26so1535019lja.13 for ; Fri, 22 Mar 2019 03:28:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=YCAHKwgopKcPUZnMu1dJXHI9I6m7q/taFL1hkpiTgpY=; b=F3S1et8RS6pJ+7c0wDz/ZPCTLBFXh9LSy+2yylrfhaJOMg3Vft7ab1v8ovv/Ys4Cew Dry6N60ylmXdACBrAxHwujuV5WO09itBAvkmcitEcWz4mwHV6RE6L1dUFVMRUea97eiz C+BEQfoUqFyfnGDiMsgScJbPE4cfGUGVfqmeLQ3KKqnBFirNux/dRTx/xhuEbhxGxsXL lrOXu6MtYdOc6IKFfIfn2/2VwbRGxhTjXhbYoua50X9obpiBtoM8fbfPc5TOGXmCwIYU QdosCU+n8/ML61LdKN0wQaG8uyfgiSj/kcHOIjGzJ/2sW+ub/zzV3w3dtqUYmUGy605R 3XKA== X-Gm-Message-State: APjAAAXn/K8oO3hv0qiZcPYYjPdft47SEvvj3X0XAHI5wuTWUyBVlNWj mSuCPTaFAB/B3Nd1yKixMZk= X-Google-Smtp-Source: APXvYqxP1W23UBC6L5ZZrgPtBf3lxUliSoT0z6tXiHEdM7Z9Vk1RiBh6BNx+0duXrvOHvxLzWhAp+A== X-Received: by 2002:a2e:8986:: with SMTP id c6mr3216572lji.146.1553250535279; Fri, 22 Mar 2019 03:28:55 -0700 (PDT) Received: from [192.168.1.10] (dsl-hkibng32-54fbf8-78.dhcp.inet.fi. [84.251.248.78]) by smtp.gmail.com with ESMTPSA id n5sm1580754lfh.6.2019.03.22.03.28.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Mar 2019 03:28:54 -0700 (PDT) Subject: Re: GiST VACUUM To: Andrey Borodin Cc: Michael Paquier , Thomas Munro , Robert Haas , pgsql-hackers , =?UTF-8?B?0JrQvtGB0YLRjyDQmtGD0LfQvdC10YbQvtCy?= References: <479336FE-B713-4DFB-9661-9BFCCA70F4EF@yandex-team.ru> <4A1FF988-A69D-4607-8A6E-B3EC0FD6C2CF@yandex-team.ru> <43f15ab5-dd95-97d4-658b-e9954ca986a6@iki.fi> <20181002011404.GU11712@paquier.xyz> <96ec7ebd-42b9-4df5-18a4-42181c8a5a41@iki.fi> <1972C522-9019-4B9D-A6DF-3A5786688DB8@yandex-team.ru> <7e3f29b6-de18-6bd5-ab06-db2eaa180173@iki.fi> <68ea7682-65e5-0dd4-84c9-104e98c2151a@iki.fi> <36666F0F-F00A-4B44-97F9-F65223CA19CA@yandex-team.ru> <738ecf7d-abc1-ed64-6af7-09eb6d9f3d2f@iki.fi> <5742CFFD-3A65-4980-9091-D74BE7C6D9E3@yandex-team.ru> From: Heikki Linnakangas Message-ID: <8663c730-0895-cf80-acc2-e7149f6455e6@iki.fi> Date: Fri, 22 Mar 2019 12:28:53 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <5742CFFD-3A65-4980-9091-D74BE7C6D9E3@yandex-team.ru> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 22/03/2019 10:00, Andrey Borodin wrote: >> 22 марта 2019 г., в 1:04, Heikki Linnakangas >> написал(а): >> >> PS. for Gist, we could almost use the LSN / NSN mechanism to detect >> the case that a deleted page is reused: Add a new field to the GiST >> page header, to store a new "deleteNSN" field. When a page is >> deleted, the deleted page's deleteNSN is set to the LSN of the >> deletion record. When the page is reused, the deleteNSN field is >> kept unchanged. When you follow a downlink during search, if you >> see that the page's deleteNSN > parent's LSN, you know that it was >> concurrently deleted and recycled, and should be ignored. That >> would allow reusing deleted pages immediately. Unfortunately that >> would require adding a new field to the gist page header/footer, >> which requires upgrade work :-(. Maybe one day, we'll bite the >> bullet. Something to keep in mind, if we have to change the page >> format anyway, for some reason. > > Yeah, the same day we will get rid of invalid tuples. I can make a > patch for v13. Actually, I have a lot of patches that I want in GiST > in v13. Or v14. Cool! Here's my wishlist: * That deleteNSN thing * Add a metapage to blk #0. * Add a "level"-field to page header. * Currently, a search needs to scan all items on a page. If the keys are small, that can be pretty slow. Divide each page further into e.g. 4 sub-pages, with a "bounding box" key for each sub-page, to speed up search. - Heikki