News for hackers. Stuff that matters.
Re:Reddit's photo albums broke due to Integer overflow of Si... by function_seven on Tuesday December 13, 2022 @07:28PM (#33978363)
Doesn't numeric storage save space and make indexing faster? (This is a naive question, I'm not asserting it.)

Yeah, numbers get you fun stuff like overflows and wrap-arounds, etc. But sorting is faster (sorting "99" before "100" is more complex than 99 before 100) and space requirement is lower (6 bytes can store a unique ID for 281 trillion objects, but 6 characters only permits 1 million if you're storing them as strings).

Or is there some datatype that combines the space- and sort-efficiency of a numeric type, but doesn't bring the baggage of assuming they represent quantities?

Re:Reddit's photo albums broke due to Integer overflow of Si... by skunkworker on Wednesday December 14, 2022 @01:26AM (#33980643)
XID wraparound is one of the things that makes me wish Postgres would go 64bit on some of their internal data structures.