Re: useless LIMIT_OPTION_DEFAULT

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Zhang Mingli <zmlpostgres(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Surafel Temesgen <surafel3000(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: useless LIMIT_OPTION_DEFAULT
Date: 2023-12-14 21:47:05
Message-ID: 2828941.1702590425@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Zhang Mingli <zmlpostgres(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2023-12-14 22:44:14 Re: Simplify newNode()
Previous Message Tom Lane 2023-12-14 21:38:17 Re: Teach predtest about IS [NOT] <boolean> proofs