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 1rEXkW-0068so-QC for pgsql-hackers@arkaria.postgresql.org; Sat, 16 Dec 2023 16:42:49 +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 1rEXkT-00Cg1h-3m for pgsql-hackers@arkaria.postgresql.org; Sat, 16 Dec 2023 16:42:45 +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 1rEXkR-00Cfx5-O8 for pgsql-hackers@lists.postgresql.org; Sat, 16 Dec 2023 16:42:44 +0000 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rEXkK-00Ahl2-0A for pgsql-hackers@lists.postgresql.org; Sat, 16 Dec 2023 16:42:41 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 8FCA83200A79; Sat, 16 Dec 2023 11:42:32 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Sat, 16 Dec 2023 11:42:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1702744952; x= 1702831352; bh=tDaYBFAoOPunXoJsgnQ7WqAMqZMJQjqrqvzUHaRe2Pg=; b=9 t8q64CGcWZHbT4nx/DvXKxvxGnH2++3iphEV0NJueJmabNebIV+F6Nbmn/jRCFFH XnOgZH5ahYdnKQmidfyufNhNHKmKegNCf4JcA1ES+sFvRR7uarFpt7w7W7uSnSIU 6xKIHqQfeu6dWRxdbNtcfL0goZD4KLYKQz/RV+jAJLocVQgYTZhYB0jS7p9E/WIP qrrmZzHzwKNlTmmLb/v8aCxFUtBVQv+U+bClLVeHb/R+w2jQj5HpQSSbofYZu26Q Kj8gVrEKYClzWVh6HrOrLz1eAAiqqFNy+ZEKJhSBVYVW8Ptc5nElnP3TzJOjXc15 hC8udUNwNiixzW3pg18pA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvddtgedgledvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkgggtugfgjgesthekredttddtjeenucfhrhhomheptehlvhgr rhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh eqnecuggftrfgrthhtvghrnhepueeigfffueektdfgteeuuefgtedvueehgfehleefheel jeelfeffjedttdekvdejnecuffhomhgrihhnpehpohhsthhgrhdrvghspdgvnhhtvghrph hrihhsvggusgdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgr ihhlfhhrohhmpegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 16 Dec 2023 11:42:31 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1702744948; bh=xBHe104QsVdXp0tV9YvfxevUYEJw5Gq6NGiUhrsGb20=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=VC61B8EBH/n2fTnNWo6z1Vpdb21ZKM+ANkqzOgk0K3mhJHx0WtbXQ802YZi46iaIQ c7HsyuMslVno98peUI1RdDegr7eW1OMujJGoPCRIfIwdjcC+JGBEBO5LeBisYUko6D g16NLCWqBr9tUUQZMv4S3aRADmeGjYzrYO7kInreKiJqzyqUZL0rKL8qy4kx4Y8ytD +McsYsQnCQFD8flc+V5DSbJkKQXPKRigZTctxtmpI+yPTN110wNfJn1ULNemVwFtD2 kORJzwBLdnpJJOfSQEYQCykAw7lKGciIHwUe6mRxeOnRLtJrnhY4MUXap6IDZgh9bQ lfNn/Hf4u1M3w== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id 265973B1; Sat, 16 Dec 2023 17:42:28 +0100 (CET) Date: Sat, 16 Dec 2023 17:42:28 +0100 From: Alvaro Herrera To: Tom Lane Cc: Zhang Mingli , Surafel Temesgen , PostgreSQL Hackers Subject: Re: useless LIMIT_OPTION_DEFAULT Message-ID: <202312161642.dzsvloromlfl@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2828941.1702590425@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2023-Dec-14, Tom Lane wrote: > Zhang Mingli writes: > > By reading the codes, I found that we process limit option as LIMIT_OPTION_WITH_TIES when using WITH TIES > > and all others are LIMIT_OPTION_COUNT by  commit 357889eb17bb9c9336c4f324ceb1651da616fe57. > > And check actual limit node in limit_needed(). > > There is no need to maintain a useless default limit enum. > > I agree, that looks pretty useless. Our normal convention for > representing not having any LIMIT clause would be to not create > a SelectLimit node at all. I don't see why allowing a second > representation is a good idea, especially when the code is not > in fact doing that. > > git blame shows that this came in with 357889eb1. Alvaro, > Surafel, do you want to argue for keeping things as-is? I looked at the history of this. That enum member first appeared as a result of your review at [1], and the accompanying code at that time did use it a few times. The problem is that I later ([2]) proposed to rewrite that code and remove most of the uses of that enum member, but failed to remove it completely. So, I think we're OK to remove it. I'm going to push Zhang's patch soon unless there are objections. [1] https://postgr.es/m/3277.1567722389@sss.pgh.pa.us [2] https://postgr.es/m/20191125203442.GA30191@alvherre.pgsql -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ "Doing what he did amounts to sticking his fingers under the hood of the implementation; if he gets his fingers burnt, it's his problem." (Tom Lane)