forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commita8c09da
committed
Remove trailing zero words from Bitmapsets
Prior to this, Bitmapsets could contain trailing words which had nomembers set. Many places in bitmapset.c had to loop over trailing wordsto check for empty words. If we ensure we always remove these trailingzero words then we can perform various optimizations such as fastpathing bms_is_subset to return false when 'a' has more words than 'b'.A similar optimization is possible in bms_equal. Both of these togethercan yield quite significant performance increases in the query plannerwhen querying a partitioned table with around 100 or more partitions.While we're at it, since the minimum number of words a Bitmapset cancontain is 1, we can make use of do/while loops instead of for loopswhen looping over all words in a set. This means checking the loopcondition 1 less time, which for single-word sets cuts the loopcondition checks in half.Author: David RowleyReviewed-by: Yuya WatariDiscussion:https://postgr.es/m/CAApHDvr5O41MuUjw0DQKqmAnv7QqvmLqXReEd5o4nXTzWp8-+w@mail.gmail.com1 parent44e73a4 commita8c09da
1 file changed
+236
-183
lines changed0 commit comments
Comments
(0)