Re: Retire has_multiple_baserels() - Mailing list pgsql-hackers

From Richard Guo
Subject Re: Retire has_multiple_baserels()
Date
Msg-id CAMbWs4_HGVQOXJc87H-x5n8TKtCTObSS++Hi_XRWCYCmWTD-Nw@mail.gmail.com
Whole thread Raw
In response to Re: Retire has_multiple_baserels()  (Aleksander Alekseev <aleksander@timescale.com>)
List pgsql-hackers

On Tue, Oct 10, 2023 at 5:43 PM Aleksander Alekseev <aleksander@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_baserels(PlannerInfo *root)
                /* ignore RTEs that are "other rels" */
                if (brel->reloptkind == RELOPT_BASEREL)
                        if (++num_base_rels > 1)
+                       {
+
Assert(bms_membership(root->all_baserels) == BMS_MULTIPLE);
                                return true;
+                       }
        }
+
+       Assert(bms_membership(root->all_baserels) != BMS_MULTIPLE);
        return false;
 }
```

It wasn't. The patch LGTM.

Thanks for the verification.

Thanks
Richard

pgsql-hackers by date:

Previous
From: Matthias van de Meent
Date:
Subject: Re: Lowering the default wal_blocksize to 4K
Next
From: Gurjeet Singh
Date:
Subject: Re: [PoC/RFC] Multiple passwords, interval expirations