News for hackers. Stuff that matters.
Re:UUIDs in MySQL are really not random by jrochkind1 on Tuesday February 05, 2019 @10:40AM (#19086238)
Aha, UUID v1! The author really wanted/expected a UUIDv4 there probably. It's confusing that we talk about "UUIDs", when there are a variety of different kinds -- called "versions" but they're not really "versions" in the sense of updated/replaced algorithms, just different approaches.

I don't know if MySQL has built-in UUIDv4 though. pg does.

Re:UUIDs in MySQL are really not random by jerf on Tuesday February 05, 2019 @10:43AM (#19086288)
UUIDs have the same problem RAID levels do; they use numbers to identify different types, but the types aren't related to each other in the way numbers are related to each other (some sort of sequential operation where "thing 3" has less of whatever it is than "thing 4" does, be it age, quality, benefits and costs like certification levels, whatever). I can never keep straight which level of RAID is which either, since I only brush them every couple of years, but if they were named for what they are instead of by number I wouldn't have this problem. I would know what "RAID Full Mirroring" or "RAID Striped" were much more easily.

We really ought to use names for them, not version numbers. If someone wrote "Timestamp-based UUIDs Are Not Fully Random", well, by the time you've typed out the title of your blog post you'd have figured out what the problem was.

Re:UUIDs in MySQL are really not random by jrochkind1 on Tuesday February 05, 2019 @11:56AM (#19087101)
even if using numbers, in retrospect they should have maybe both been called "types" UUID type 1 or 4. RAID type 1 or 3. To avoid the association that both "version" and "level" have, that the numbers are incrementing the functionality in some way.
Re:UUIDs in MySQL are really not random by ken on Tuesday February 05, 2019 @02:09PM (#19088627)
Words always get truncated or omitted, though. It's technically UUID "version 1" (I think), but see how everybody just says "UUID 1". Teaching people to say "type" instead of "version" wouldn't do much good because most people aren't saying any word there anyway.

I'd prefer to use letters in cases like this. Letters have a much weaker association with ordering, there's no implication that the set is of infinite size, and there's no affordance for doing anything arithmetic with them except enumerating them.

For example, a plain old USB cable has an "A" and "B" ends, radiation can be alpha/beta/gamma, and power outlets can be type A, B, C, ... (it looks like they're up to "N" now). Nobody would think that a Danish "type K" plug is 9 versions improved on an American "type B" plug. It's just different.

Re:UUIDs in MySQL are really not random by Dylan16807 on Tuesday February 05, 2019 @04:45PM (#19090169)
>see how everybody just says "UUID 1"

Are you sure? If they have the number I always see a "v" in front of it.

Re:UUIDs in MySQL are really not random by jerf on Tuesday February 05, 2019 @03:37PM (#19089552)
Yeah, letters are much more used in situations where they do not denote some sort of order. They do, at least in English, but it's a much weaker association. It seems on some level we intuit that letter orders are arbitrary, whereas in some sense integers are literally nothing but their order.
Re:UUIDs in MySQL are really not random by giancarlostoro on Tuesday February 05, 2019 @01:14PM (#19087929)
At least with RAID it's enumeration that'd solve that. With UUID, I'm not sure. I wonder where IPv4 vs IPv6 falls under in this mess too.
Re:UUIDs in MySQL are really not random by jrochkind1 on Tuesday February 05, 2019 @05:37PM (#19090725)
IPv6 actually _is_ a newer version of the Internet Protocol. I think that is a plain old version. Sure, we don't know what happened to IPv5 (unless we google it), but that's not that weird, that happens with other things and their versions, versions get abandoned.
Re:UUIDs in MySQL are really not random by dvlsg on Tuesday February 05, 2019 @01:30PM (#19088170)
Is it built in to pg now? Last time I set up pg I had to add an extension to get UUID support.

It was relatively painless, sure, but I seem to remember having to add it.

Re:UUIDs in MySQL are really not random by brlewis on Tuesday February 05, 2019 @01:34PM (#19088222)
The pgcrypto module ships with pg but you have to enable it. https://www.postgresql.org/docs/10/pgcrypto.html#id-1.11.7.3...
Re:UUIDs in MySQL are really not random by Waterluvian on Tuesday February 05, 2019 @07:30PM (#19091549)
I think "version" is the right word if you take it in the traditional sense, not the common technical meaning.