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 1rDtY5-003UgR-JE for pgsql-hackers@arkaria.postgresql.org; Thu, 14 Dec 2023 21:47:17 +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 1rDtY4-00CHlg-3G for pgsql-hackers@arkaria.postgresql.org; Thu, 14 Dec 2023 21:47:16 +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 1rDtY3-00CHlY-Pi for pgsql-hackers@lists.postgresql.org; Thu, 14 Dec 2023 21:47:15 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rDtXx-00AQQr-8D for pgsql-hackers@lists.postgresql.org; Thu, 14 Dec 2023 21:47:14 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 3BELl5mT2828942; Thu, 14 Dec 2023 16:47:05 -0500 From: Tom Lane To: Zhang Mingli cc: Alvaro Herrera , Surafel Temesgen , PostgreSQL Hackers Subject: Re: useless LIMIT_OPTION_DEFAULT In-reply-to: <59d61a1a-3858-475a-964f-24468c97cc67@Spark> References: <59d61a1a-3858-475a-964f-24468c97cc67@Spark> Comments: In-reply-to Zhang Mingli message dated "Thu, 14 Dec 2023 09:17:33 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <2828940.1702590425.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 14 Dec 2023 16:47:05 -0500 Message-ID: <2828941.1702590425@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Zhang Mingli writes: > By reading the codes, I found that we process limit option as LIMIT_OPTI= ON_WITH_TIES when using WITH TIES > and all others are LIMIT_OPTION_COUNT by=C2=A0=C2=A0commit 357889eb17bb9= c9336c4f324ceb1651da616fe57. > 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? regards, tom lane