As it's mentioned in this TODO comment that was introduced in
CASSANDRA-8272, replica filtering protection would benefit from a ReadCommand implementation able to internally read the rows identified by a group of primary keys residing in different partitions.
It would be different from SinglePartitionReadCommand.Group in that it wouldn't need to be split in per-partition commands when sending it to a replica. We could call it MultiPartitionReadCommand, for example.
Such command would also be beneficial for the performance of regular IN CQL queries, since it would reduce the traffic between the coordinator and the replicas by grouping the queries sent to a replica.
An alternative way of getting that performance gain could be modifying how the current SinglePartitionReadCommand.Group is executed on the StorageProxy so, instead of sending each of its internal SinglePartitionReadCommand s to the replicas, we could split it in smaller Group commands targeted to specific replicas, if that makes sense.