Details
-
Task
-
Status: Resolved
-
Resolution: Fixed
-
None
-
None
-
None
-
114
Description
One technique to prevent write hot-spotting when you have a monotonically increasing key is to reverse the bits. This works well if you don't need to do a range scan across the values. One use case is when your first column represents a tenant ID in a multi tenant system.
This would be implemented by building on the fix for [this issue](https://github.com/forcedotcom/phoenix/issues/58):
1. Add a new enum for REVERSE
2. Change the serialization/deserialization code in PDataType to reverse the bits in the case of REVERSE.
3. Disallow range scans on columns of type REVERSE. This could be caught in ExpressionCompiler_visitLeave(ComparisonParseNode,List<Expression>) and ExpressionCompiler_visitLeave(LikeParseNode,List<Expression>). These are the two cases I can think of that result in range scans.