Re: useless LIMIT_OPTION_DEFAULT
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Zhang Mingli <zmlpostgres@gmail.com>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>,
Surafel Temesgen <surafel3000@gmail.com>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2023-12-14T21:47:05Z
Lists: pgsql-hackers
Zhang Mingli <zmlpostgres@gmail.com> 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? regards, tom lane
Commits
-
Remove useless LIMIT_OPTION_DEFAULT value from LimitOption
- a6be0600ac3b 17.0 landed
-
Support FETCH FIRST WITH TIES
- 357889eb17bb 13.0 cited