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
>
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
>> bms_membership
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 @@ has_multiple_bas
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) == BMS_
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
all_ba