netudima commented on code in PR #4589:
URL: https://github.com/apache/cassandra/pull/4589#discussion_r2769824079


##########
src/java/org/apache/cassandra/cql3/restrictions/PartitionKeyRestrictions.java:
##########
@@ -191,6 +193,17 @@ public AbstractBounds<PartitionPosition> 
bounds(IPartitioner partitioner, QueryO
      */
     private List<ByteBuffer> nonTokenRestrictionValues(QueryOptions options, 
ClientState state)
     {
+        // fast path, a typical case when a single full restriction is used
+        // for example, when we specify a single partition key to modify
+        if (restrictions.size() == 1 && !restrictions.hasIN())
+        {
+            SingleRestriction r = restrictions.lastRestriction();
+            List<ClusteringElements> values = r.values(options);
+            if (values.size() == 1)
+                return toByteBuffers(Clustering.make(values.get(0).toArray(new 
ByteBuffer[comparator.size()])));

Review Comment:
   thank you for the idea, I've applied it



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