Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f94wq-0002dM-T8 for pgsql-committers@arkaria.postgresql.org; Thu, 19 Apr 2018 08:29:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f94wp-0008Au-QJ for pgsql-committers@arkaria.postgresql.org; Thu, 19 Apr 2018 08:29:43 +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_SHA384:256) (Exim 4.89) (envelope-from ) id 1f94wp-0008Al-LF for pgsql-committers@lists.postgresql.org; Thu, 19 Apr 2018 08:29:43 +0000 Received: from hook.sigaev.ru ([93.180.27.50]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f94wl-0001X4-Gs for pgsql-committers@lists.postgresql.org; Thu, 19 Apr 2018 08:29:43 +0000 Received: from xor.sai.msu.ru (unknown [93.174.131.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: teodor) by hook.sigaev.ru (Postfix) with ESMTPSA id CB032B191A0; Thu, 19 Apr 2018 11:29:38 +0300 (MSK) Subject: Re: pgsql: Skip full index scan during cleanup of B-tree indexes when possi To: Alexander Korotkov , Peter Geoghegan Cc: Fujii Masao , pgsql-committers References: From: Teodor Sigaev Message-ID: <7152e7dd-4448-8e9b-1e28-8139035a1fd4@sigaev.ru> Date: Thu, 19 Apr 2018 11:29:38 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Firefox/52.0 SeaMonkey/2.49.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Thank you, both patches are pushed. Alexander Korotkov wrote: > On Wed, Apr 18, 2018 at 9:21 PM, Peter Geoghegan > wrote: > > On Wed, Apr 18, 2018 at 11:12 AM, Fujii Masao > wrote: > > On Thu, Apr 5, 2018 at 1:29 AM, Teodor Sigaev > wrote: > >> Skip full index scan during cleanup of B-tree indexes when possible > > > > This commit added XLOG_BTREE_META_CLEANUP, so btree_desc() and > > btree_identify() should be updated so that they handle XLOG_BTREE_META_CLEANUP. > > But ISTM that you forgot doing that. > > Thank you for notice.š See attached > bt-vacuum-cleanup-wal-record-desc-identify.patch fixing that. > > Another thing that I noticed is that the metapage stores > btm_last_cleanup_num_heap_tuples as a float4, even though > xl_btree_metadata stores it as a double. I suggest that both places > store it as float8, to be consistent. (It should not be double because > we always avoid using anything other types with explicit typedef'd > widths in WAL records.) > > > Good catch, thank you!š I also agree that both these fields should be of float8 > type. > Please, find attachedšbt-vacuum-cleanup-float8-num-heap-tuples.patch fixing that. > > ------ > Alexander Korotkov > Postgres Professional:http://www.postgrespro.com > The Russian Postgres Company > -- Teodor Sigaev E-mail: teodor@sigaev.ru WWW: http://www.sigaev.ru/