Re: Retire has_multiple_baserels()

2023-10-10 Thread Richard Guo
On Wed, Oct 11, 2023 at 1:13 AM Tom Lane wrote: > I thought this test wasn't too complete, because has_multiple_baserels > isn't reached at all in many cases thanks to the way the calling if() > is coded. I tried testing like this instead: > > diff --git a/src/backend/optimizer/path/allpaths.c

Re: Retire has_multiple_baserels()

2023-10-10 Thread Tom Lane
Aleksander Alekseev writes: >> The function has_multiple_baserels() is used in set_subquery_pathlist() >> to check and see if there are more than 1 base rel, by looping through >> simple_rel_array[]. I think one simpler way to do that is to leverage >> root->all_baserels by >>

Re: Retire has_multiple_baserels()

2023-10-10 Thread Richard Guo
On Tue, Oct 10, 2023 at 5:43 PM Aleksander Alekseev < aleksan...@timescale.com> wrote: > I used the following patch to double check that nothing was missed: > > ``` > --- a/src/backend/optimizer/path/allpaths.c > +++ b/src/backend/optimizer/path/allpaths.c > @@ -2207,8 +2207,13 @@

Re: Retire has_multiple_baserels()

2023-10-10 Thread Aleksander Alekseev
Hi, > The function has_multiple_baserels() is used in set_subquery_pathlist() > to check and see if there are more than 1 base rel, by looping through > simple_rel_array[]. I think one simpler way to do that is to leverage > root->all_baserels by > > bms_membership(root->all_baserels) ==

Retire has_multiple_baserels()

2023-10-10 Thread Richard Guo
The function has_multiple_baserels() is used in set_subquery_pathlist() to check and see if there are more than 1 base rel, by looping through simple_rel_array[]. I think one simpler way to do that is to leverage root->all_baserels by bms_membership(root->all_baserels) == BMS_MULTIPLE