Fixup some misusages of bms_num_members()
David Rowley <drowley@postgresql.org>
Fixup some misusages of bms_num_members() It's a bit inefficient to test if a Bitmapset is empty by counting all the members and seeing if that number is zero. It's much better just to use bms_is_empty(). Likewise for checking if there are at least two members, just use bms_membership(), which does not need to do anything more after finding two members. Discussion: https://postgr.es/m/CAApHDvpvwm_QjbDOb5xga%2BKmX9XkN9xQavNGm3SvDbVnCYOerQ%40mail.gmail.com Reviewed-by: Tomas Vondra
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/optimizer/path/clausesel.c | modified | +1 −2 |
| src/backend/statistics/dependencies.c | modified | +4 −4 |
Discussion
- Fix a couple of misuages of bms_num_members() 3 messages · 2020-08-25