aweisberg commented on code in PR #3777:
URL: https://github.com/apache/cassandra/pull/3777#discussion_r1915651378


##########
src/java/org/apache/cassandra/service/reads/range/RangeCommandIterator.java:
##########
@@ -187,6 +199,50 @@ static int computeConcurrencyFactor(int totalRangeCount, 
int rangesQueried, int
         return concurrencyFactor;
     }
 
+    private PartitionIterator executeAccord(ClusterMetadata cm, 
PartitionRangeReadCommand rangeCommand, ConsistencyLevel cl)
+    {
+        //TODO (nicetohave): This is very inefficient because it will not map 
to the command store owned ranges
+        // so every command store will return results up to the limit and most 
could be discarded.
+        // Really we want to split the ranges by command stores owned ranges 
and then query one at a time
+        // For this to work well it really needs to integrated upwards where 
the ranges to query are being picked
+        AsyncTxnResult result = StorageProxy.readWithAccord(cm, rangeCommand, 
ImmutableList.of(rangeCommand.dataRange().keyRange()), cl, requestTime);

Review Comment:
   This example query is not a range query, `IN` executes as multiple single 
partition queries. That's one of the use cases for single partition reads have 
`Group`.
   
   Reading serially is fundamentally how we read at a node. We merge sstables 
returning partitions in token order and stop once we hit the limit. Reading on 
Accord splits the range into N concurrent reads and we don't know which ones 
will have results or how many so they are merged and then the limit is applied 
again.
   
   It could be done serially until enough rows to satisfy the limit have been 
collected and this is exactly how `RangeCommandIterator` works because it 
doesn't know how many results it will get from each command.



-- 
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