fixing typo in comment for restriction_is_or_clause

2022-10-24 Thread Zhihong Yu
Hi, When I was looking at src/backend/optimizer/util/restrictinfo.c, I found a typo in one of the comments. I also took the chance to simplify the code a little bit. Please take a look at the patch. Thanks is-or.patch Description: Binary data

Re: fixing typo in comment for restriction_is_or_clause

2022-10-24 Thread John Naylor
On Tue, Oct 25, 2022 at 12:19 AM Zhihong Yu wrote: > > Hi, > When I was looking at src/backend/optimizer/util/restrictinfo.c, I found a typo in one of the comments. Using "t" as an abbreviation for "true" was probably intentional, so not a typo. There is no doubt what the behavior is. > I also t

Re: fixing typo in comment for restriction_is_or_clause

2022-10-24 Thread Richard Guo
On Tue, Oct 25, 2022 at 10:05 AM John Naylor wrote: > > On Tue, Oct 25, 2022 at 12:19 AM Zhihong Yu wrote: > > > > Hi, > > When I was looking at src/backend/optimizer/util/restrictinfo.c, I found > a typo in one of the comments. > > Using "t" as an abbreviation for "true" was probably intentiona

Re: fixing typo in comment for restriction_is_or_clause

2022-10-24 Thread Japin Li
On Tue, 25 Oct 2022 at 10:48, Richard Guo wrote: > On Tue, Oct 25, 2022 at 10:05 AM John Naylor > wrote: > >> >> On Tue, Oct 25, 2022 at 12:19 AM Zhihong Yu wrote: >> > >> > Hi, >> > When I was looking at src/backend/optimizer/util/restrictinfo.c, I found >> a typo in one of the comments. >> >

Re: fixing typo in comment for restriction_is_or_clause

2022-10-24 Thread Zhihong Yu
On Mon, Oct 24, 2022 at 7:58 PM Japin Li wrote: > > On Tue, 25 Oct 2022 at 10:48, Richard Guo wrote: > > On Tue, Oct 25, 2022 at 10:05 AM John Naylor < > john.nay...@enterprisedb.com> > > wrote: > > > >> > >> On Tue, Oct 25, 2022 at 12:19 AM Zhihong Yu wrote: > >> > > >> > Hi, > >> > When I was

Re: fixing typo in comment for restriction_is_or_clause

2022-10-24 Thread Japin Li
On Tue, 25 Oct 2022 at 11:07, Zhihong Yu wrote: > Please take a look at patch v2. Maybe we should define those functions in headers. See patch v3. -- Regrads, Japin Li. ChengDu WenWu Information Technology Co.,Ltd. diff --git a/src/backend/optimizer/util/restrictinfo.c b/src/backend/optimize

Re: fixing typo in comment for restriction_is_or_clause

2022-10-24 Thread Richard Guo
On Tue, Oct 25, 2022 at 11:46 AM Japin Li wrote: > > On Tue, 25 Oct 2022 at 11:07, Zhihong Yu wrote: > > Please take a look at patch v2. > > Maybe we should define those functions in headers. See patch v3. Yes, putting them in .h file is better to me. For the v3 patch, we can do the same one-

Re: fixing typo in comment for restriction_is_or_clause

2022-10-24 Thread Japin Li
On Tue, 25 Oct 2022 at 12:01, Richard Guo wrote: > On Tue, Oct 25, 2022 at 11:46 AM Japin Li wrote: > >> >> On Tue, 25 Oct 2022 at 11:07, Zhihong Yu wrote: >> > Please take a look at patch v2. >> >> Maybe we should define those functions in headers. See patch v3. > > > Yes, putting them in .h

Re: fixing typo in comment for restriction_is_or_clause

2022-10-24 Thread John Naylor
On Tue, Oct 25, 2022 at 9:48 AM Richard Guo wrote: > > > On Tue, Oct 25, 2022 at 10:05 AM John Naylor wrote: >> >> It's perfectly clear and simple now, even if it doesn't win at "code golf". > > > Agree with your point. Do you think we can further make the one-line > function a macro or an inlin

Re: fixing typo in comment for restriction_is_or_clause

2022-10-25 Thread Alvaro Herrera
On 2022-Oct-25, Richard Guo wrote: > Agree with your point. Do you think we can further make the one-line > function a macro or an inline function in the .h file? We can, but should we? > I think this function is called quite frequently during planning, so > maybe doing that would bring a littl

Re: fixing typo in comment for restriction_is_or_clause

2022-10-25 Thread Richard Guo
On Tue, Oct 25, 2022 at 2:25 PM John Naylor wrote: > > On Tue, Oct 25, 2022 at 9:48 AM Richard Guo > wrote: > > > > > > On Tue, Oct 25, 2022 at 10:05 AM John Naylor < > john.nay...@enterprisedb.com> wrote: > >> > >> It's perfectly clear and simple now, even if it doesn't win at "code > golf". >

Re: fixing typo in comment for restriction_is_or_clause

2022-10-25 Thread Richard Guo
On Tue, Oct 25, 2022 at 3:37 PM Alvaro Herrera wrote: > On 2022-Oct-25, Richard Guo wrote: > > > Agree with your point. Do you think we can further make the one-line > > function a macro or an inline function in the .h file? > > We can, but should we? > > > I think this function is called quite