4 ms·
I thought what was bad was monotonically increasing keys, not values. The solution, assuming for instance that you are indexing by timestamp, and your timestam
by candeira 16y ago
I thought what was bad was monotonically increasing keys, not values.
The solution, assuming for instance that you are indexing by timestamp, and your timestamp is a string: index by timestamp[::-1] (reverse the string).
Solved, next problem?
- praptak 16y agoYeah, now try to fetch records from a particular hour. Seriously, it is better to get rid of timestamp indexing altogether instead of having an index that is basically useless for anything but fetching an exact timestamp.
- candeira 16y agoThe same problem exists for any monotonically increasing key, and the same solution can be used. Sequential ids for events, whatever. The timestamp was just an admittedly not very wise reuse of a not very good example.