diff options
| author | Tom Lane | 2023-03-02 16:34:29 +0000 |
|---|---|---|
| committer | Tom Lane | 2023-03-02 16:34:29 +0000 |
| commit | 462bb7f12851c215dfc21a88ae0ed4bf7fcb36a3 (patch) | |
| tree | 1ab5f6429f5833fd548c1eb079d6129339acb077 /src/backend/optimizer | |
| parent | 2f80c95740f88e9e3e04ee0c2063e55a497315b4 (diff) | |
Remove bms_first_member().
This function has been semi-deprecated ever since we invented
bms_next_member(). Its habit of scribbling on the input bitmapset
isn't great, plus for sufficiently large bitmapsets it would take
O(N^2) time to complete a loop. Now we have the additional problem
that reducing the input to empty while leaving it still accessible
would violate a planned invariant. So let's just get rid of it,
after updating the few extant callers to use bms_next_member().
Patch by me; thanks to Nathan Bossart and Richard Guo for review.
Discussion: https://postgr.es/m/1159933.1677621588@sss.pgh.pa.us
Diffstat (limited to 'src/backend/optimizer')
| -rw-r--r-- | src/backend/optimizer/plan/subselect.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/backend/optimizer/plan/subselect.c b/src/backend/optimizer/plan/subselect.c index 04eda4798ef..22ffe4ca425 100644 --- a/src/backend/optimizer/plan/subselect.c +++ b/src/backend/optimizer/plan/subselect.c @@ -1481,7 +1481,8 @@ convert_EXISTS_sublink_to_join(PlannerInfo *root, SubLink *sublink, */ clause_varnos = pull_varnos(root, whereClause); upper_varnos = NULL; - while ((varno = bms_first_member(clause_varnos)) >= 0) + varno = -1; + while ((varno = bms_next_member(clause_varnos, varno)) >= 0) { if (varno <= rtoffset) upper_varnos = bms_add_member(upper_varnos, varno); |
