pkolaczk commented on code in PR #3054:
URL: https://github.com/apache/cassandra/pull/3054#discussion_r1468094594


##########
src/java/org/apache/cassandra/index/sai/iterators/KeyRangeIntersectionIterator.java:
##########
@@ -77,8 +81,23 @@ protected PrimaryKey computeNext()
                 if (index != alreadyAvanced)
                 {
                     KeyRangeIterator range = ranges.get(index);
-                    PrimaryKey nextKey = nextOrNull(range, highestKey);
-                    if (nextKey == null || nextKey.compareTo(highestKey) > 0)
+                    PrimaryKey nextKey = range.getCurrent();
+
+                    // Note that we will either have a data model that 
produces SKINNY primary keys or a data model
+                    // that produces some combination of WIDE and STATIC 
prikary keys.
+                    if (nextKey.kind() == Kind.WIDE || nextKey.kind() == 
highestKey.kind())
+                        // We can always skip if the target is of the same 
kind or this range is non-static. 
+                        nextKey = nextOrNull(range, highestKey);
+                    else if (nextKey.kind() == Kind.STATIC && 
nextKey.compareTo(highestKey) < 0)

Review Comment:
   Funny how I had exactly same question and realized later the if condition on 
line 88 would catch that case. 
   Yeah, it was a bit non-obvious, but looks correct. Anyway, the final version 
has fewer conditions. Take a look at that one.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to