Single partition transaction

Hello, I’ve got a question about transaction.
There are two rows in two tables with partition keys belonging to the same partition(shard)
Does CockroachDB optimize execution in this case?

Example:
Table1
k1-v1

Table2
k2-v2

hash(k1)=hash(k2)

Yes, CockroachDB has optimizations for transactions that only touch a single range (our term for partition/shard). However, it wouldn’t apply to your example because two different tables can only be in the same range if they are interleaved. Hashing is not used in CockroachDB’s partitioning scheme; it is based on contiguous spans of keys.

Thank you for response.