forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit930d2b4
committed
Don't use bms_membership() in cases where we don't need to
00b4146 adjusted Bitmapset so that an empty set is always representedas NULL. This makes checking for empty sets far cheaper than it usedto be.There were various places in the code where we'd call bms_membership()to handle the 3 possible BMS_Membership values. For the BMS_SINGLETONcase, we'd also call bms_singleton_member() to find the single set member.This can now be done in a more optimal way by first checking if the set isNULL and then not bothering with bms_membership() and simply callbms_get_singleton_member() instead to find the single member. Thisfunction will return false if there are multiple members in the set.Here we also tidy up some logic in examine_variable() for the singlemember case. There's now no need to call bms_is_member() as we'vealready established that we're working with a singleton Bitmapset, so wecan just check if varRelid matches the singleton member.Reviewed-by: Richard GuoDiscussion:https://postgr.es/m/CAApHDvqW+CxNPcY245GaWiuqkkqgTudtG2ncGvvSjGn2wdTZLA@mail.gmail.com1 parent75680c3 commit930d2b4
2 files changed
+39
-35
lines changedLines changed: 17 additions & 15 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2634 | 2634 |
| |
2635 | 2635 |
| |
2636 | 2636 |
| |
2637 |
| - | |
| 2637 | + | |
2638 | 2638 |
| |
2639 |
| - | |
| 2639 | + | |
2640 | 2640 |
| |
| 2641 | + | |
| 2642 | + | |
2641 | 2643 |
| |
2642 | 2644 |
| |
2643 | 2645 |
| |
2644 | 2646 |
| |
2645 |
| - | |
| 2647 | + | |
2646 | 2648 |
| |
2647 | 2649 |
| |
2648 | 2650 |
| |
2649 | 2651 |
| |
2650 | 2652 |
| |
2651 | 2653 |
| |
2652 | 2654 |
| |
2653 |
| - | |
2654 |
| - | |
2655 |
| - | |
| 2655 | + | |
| 2656 | + | |
| 2657 | + | |
2656 | 2658 |
| |
2657 | 2659 |
| |
2658 | 2660 |
| |
| |||
2675 | 2677 |
| |
2676 | 2678 |
| |
2677 | 2679 |
| |
2678 |
| - | |
2679 |
| - | |
2680 |
| - | |
2681 |
| - | |
2682 |
| - | |
2683 |
| - | |
2684 |
| - | |
2685 |
| - | |
2686 |
| - | |
| 2680 | + | |
| 2681 | + | |
| 2682 | + | |
| 2683 | + | |
| 2684 | + | |
| 2685 | + | |
| 2686 | + | |
| 2687 | + | |
| 2688 | + | |
2687 | 2689 |
| |
2688 | 2690 |
| |
2689 | 2691 |
| |
|
Lines changed: 22 additions & 20 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5028 | 5028 |
| |
5029 | 5029 |
| |
5030 | 5030 |
| |
5031 |
| - | |
| 5031 | + | |
5032 | 5032 |
| |
5033 |
| - | |
5034 |
| - | |
5035 |
| - | |
5036 |
| - | |
5037 |
| - | |
| 5033 | + | |
| 5034 | + | |
| 5035 | + | |
| 5036 | + | |
| 5037 | + | |
| 5038 | + | |
| 5039 | + | |
| 5040 | + | |
| 5041 | + | |
5038 | 5042 |
| |
5039 |
| - | |
5040 |
| - | |
| 5043 | + | |
5041 | 5044 |
| |
5042 | 5045 |
| |
5043 | 5046 |
| |
5044 | 5047 |
| |
5045 |
| - | |
5046 |
| - | |
| 5048 | + | |
| 5049 | + | |
| 5050 | + | |
| 5051 | + | |
5047 | 5052 |
| |
5048 | 5053 |
| |
5049 | 5054 |
| |
| |||
5058 | 5063 |
| |
5059 | 5064 |
| |
5060 | 5065 |
| |
5061 |
| - | |
| 5066 | + | |
5062 | 5067 |
| |
5063 | 5068 |
| |
5064 | 5069 |
| |
| |||
6381 | 6386 |
| |
6382 | 6387 |
| |
6383 | 6388 |
| |
6384 |
| - | |
| 6389 | + | |
6385 | 6390 |
| |
6386 |
| - | |
6387 |
| - | |
6388 |
| - | |
6389 |
| - | |
6390 |
| - | |
6391 |
| - | |
6392 |
| - | |
| 6391 | + | |
| 6392 | + | |
| 6393 | + | |
| 6394 | + | |
| 6395 | + | |
6393 | 6396 |
| |
6394 |
| - | |
6395 | 6397 |
| |
6396 | 6398 |
| |
6397 | 6399 |
| |
|
0 commit comments
Comments
(0)