-
Notifications
You must be signed in to change notification settings - Fork 227
Support transparent salting of row key #74
Comments
At a high level, we'll provide a way of declaring that a table is "salted" in our DDL and then transparently insert a byte at the beginning of the row key on upsert. For any query, we'll insert an "or" of each possible bucket value where we form the start/stop of the scan. This will cause the query to get run everywhere. We'll have a special case when we know the full row key not to do this, but to insert the correct byte. Detail on how to implement this:
Down the road, we can allow ALTER TABLE to increase, but not decrease the number of salt buckets. This would make is so that a point get would need to go everywhere too, though, so it's debatable that we'd want to allow it. |
Hi James, couple questions for this:
|
Good questions. No, I think we can return the rows in any order (otherwise, we'd have to sort as you've alluded to which would be too expensive. If the user wanted them sorted, then could add an order by clause. |
Implemented now. Great job, @tonyhuang |
To prevent hot spotting on writes:
Or alternately
The text was updated successfully, but these errors were encountered: