4 ms·
This is solved sorting by timestamp first then by random PK UUID. Don't think a little simpler batch queries justify leaking time and quantity information or co
by disneycember 2y ago
This is solved sorting by timestamp first then by random PK UUID. Don't think a little simpler batch queries justify leaking time and quantity information or complexity of handling two types of IDs.
- j45 2y agoI agree with not baking more intelligence into a piece of data than needed, especially an index.
- rezonant 2y agoYou wouldn't expose the numeric IDs publically, and ideally you'd use your database's automatic ID selection to avoid any complexity. The UUID sorting works in the common case, but if you happen to end your batch near the current time, you still run the risk of losing a few records if the insert frequency is sufficiently high. Admittedly this is only a problem when you are batching through all the way to current insertions.