A few alternative approaches to make it more "vectorized" which I think worth taking a try:
Replace visibility Bitmap with visibility Vec<usize>. This is because for idx in vec is more vectorized i.e. no branches at all so more friendly to CPU pipeline.
Similar to 1 but only do it for low-selectivity cases
Do compaction before exchange, because we know exchange will always produce low-selectivity results.
A few alternative approaches to make it more "vectorized" which I think worth taking a try:
visibility Bitmap
withvisibility Vec<usize>
. This is becausefor idx in vec
is more vectorized i.e. no branches at all so more friendly to CPU pipeline.exchange
will always produce low-selectivity results.Originally posted by @fuyufjh in https://github.com/risingwavelabs/risingwave/issues/15696#issuecomment-2002777893