bereng commented on code in PR #2105:
URL: https://github.com/apache/cassandra/pull/2105#discussion_r1083887949
##########
src/java/org/apache/cassandra/cql3/restrictions/StatementRestrictions.java:
##########
@@ -390,6 +390,53 @@ public boolean isColumnRestrictedByEq(ColumnMetadata
columnDef)
.anyMatch(p -> ((SingleRestriction) p).isEQ());
}
+ /**
+ * This method determines whether a specified column is restricted on
equality or something equivalent, like IN.
+ * It can be used in conjunction with the columns selected by a query to
determine which of those columns is
+ * already bound by the client and not necessarily retrieved by the
database.
+ *
+ * @param column a column specification from the same table these
restrictions are against
+ *
+ * @return true if the given column is restricted on equality
+ */
+ public boolean isEqualityRestricted(ColumnSpecification column)
Review Comment:
Here you're potentially traversing all columns on each call. Given you're on
a hot path, could you be feeding instead this method with `ColumnMetada`,
pulled from the restrictions, and relaying on `KIND` to spare a couple
expensive loops?
--
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]