Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1st4hq-00DLxn-Q0 for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Sep 2024 12:31:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1st4hp-007P9v-HN for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Sep 2024 12:31:49 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1st4hp-007P9n-4q for pgsql-hackers@lists.postgresql.org; Tue, 24 Sep 2024 12:31:49 +0000 Received: from smtp.outgoing.loopia.se ([93.188.3.37]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1st4hl-000o7C-Ih for pgsql-hackers@lists.postgresql.org; Tue, 24 Sep 2024 12:31:47 +0000 Received: from s807.loopia.se (localhost [127.0.0.1]) by s807.loopia.se (Postfix) with ESMTP id 98C65E4255 for ; Tue, 24 Sep 2024 14:31:41 +0200 (CEST) Received: from s979.loopia.se (unknown [172.22.191.5]) by s807.loopia.se (Postfix) with ESMTP id 831FDE47D3; Tue, 24 Sep 2024 14:31:41 +0200 (CEST) Received: from s471.loopia.se (unknown [172.22.191.5]) by s979.loopia.se (Postfix) with ESMTP id 8168E10BC444; Tue, 24 Sep 2024 14:31:41 +0200 (CEST) X-Virus-Scanned: amavisd-new at amavis.loopia.se X-Spam-Flag: NO X-Spam-Score: -1.2 X-Spam-Level: X-Spam-Status: No, score=-1.2 tagged_above=-999 required=6.2 tests=[ALL_TRUSTED=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1] autolearn=disabled Authentication-Results: s471.loopia.se (amavisd-new); dkim=pass (2048-bit key) header.d=yesql.se Received: from s980.loopia.se ([172.22.191.6]) by s471.loopia.se (s471.loopia.se [172.22.190.35]) (amavisd-new, port 10024) with LMTP id NastmT_gg5rF; Tue, 24 Sep 2024 14:31:41 +0200 (CEST) X-Loopia-Auth: user X-Loopia-User: daniel@yesql.se X-Loopia-Originating-IP: 89.255.232.193 Received: from smtpclient.apple (customer-89-255-232-193.stosn.net [89.255.232.193]) (Authenticated sender: daniel@yesql.se) by s980.loopia.se (Postfix) with ESMTPSA id F361D2201697; Tue, 24 Sep 2024 14:31:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yesql.se; s=loopiadkim1707475645; t=1727181101; bh=xWvkRsTxhH0NP0tG93W/qQeJfcPHHwgh3mkxRlFvUoI=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=VbYUw0c2b5FHPVHX8P969hB7UfLzUF017iTLwjfOJsD6U8eptiHlKxhpoE6rx/kE5 jibS8hhkmI9rfp7LjQNcnBmFgEZR0G6IsZSdPt2Wvp7WfcLKDYC73+/P5Rq//tLh4S I9l9/uUHLx1WW2EVY2VReazebHu0LQM5Im0CnIDreA9oALTVAHKHBE5YWxd+xm0Okk Cojvc2fsee3yXpfALf6lGf0Qw+IcraCmSLOWMkfn9zKdqzyMgDm1zlaBmyfucOuTHP 2/dPOPOcSmC7GDVTzgIX1sajR/xPsAV0XSz+OA7xi1AJork4XRUu5rZ7l/d784CDjQ G2cpfC2f1BQYg== Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.600.62\)) Subject: Re: index_delete_sort: Unnecessary variable "low" is used in heapam.c From: Daniel Gustafsson In-Reply-To: <8aeb7b3eda53ca4c65fbacf8f43628fb@oss.nttdata.com> Date: Tue, 24 Sep 2024 14:31:30 +0200 Cc: PostgreSQL Developers , Peter Geoghegan Content-Transfer-Encoding: quoted-printable Message-Id: <5DCA3F10-18DF-4824-8557-7F6C9295810E@yesql.se> References: <8aeb7b3eda53ca4c65fbacf8f43628fb@oss.nttdata.com> To: btnakamurakoukil X-Mailer: Apple Mail (2.3774.600.62) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On 24 Sep 2024, at 10:32, btnakamurakoukil = wrote: > I noticed unnecessary variable "low" in index_delete_sort() = (/postgres/src/backend/access/heap/heapam.c), patch attached. What do = you think? That variable does indeed seem to not be used, and hasn't been used = since it was committed in d168b666823. The question is if it's a left-over from development which can be removed, or if it should be set and we're = missing an optimization. Having not read the referenced paper I can't tell so = adding Peter Geoghegan who wrote this for clarification. -- Daniel Gustafsson