https://questdb.io logo
Title
c

Chris

01/11/2023, 3:52 PM
Hey there, I was digging in the docs for the best way to handle UUID and by chance I saw the notice about "a new UUID data type". But I'm not understanding if that has been released or not yet and if so which version it's associated with. Running 6.6.1 currently.
n

Nicolas Hourcard

01/11/2023, 3:53 PM
Hi Chris - it’s coming very soon. Not yet released
PR is quasi final
Could you take us through your use case?
c

Chris

01/11/2023, 3:55 PM
IoT. Experimenting with two scenarios - UUID for a devices table. 2nd, more interesting - experimenting with UUID for LoRawan payload tracking... assign each downlink to end device a uuid, and insert it's status from created, sent, acked by that uuid
n

Nicolas Hourcard

01/11/2023, 3:57 PM
very cool. personal project or company? let me also cc @Jaromir Hamala who is the creator of UUID
c

Chris

01/11/2023, 3:57 PM
Just on the side personally at the moment
Extraordinary job on Quest btw, coming from timescale and appreciate the simplicity, speed, and just how lightweight it feels
j

Jaromir Hamala

01/11/2023, 4:05 PM
hi Chris, I’m the author of the UUID integration work. A little bit of background behind this work: We realized UUID are stored in QuestDB a lot and right now most people store them in a String column. That’s wasteful in space and it also makes querying slow(er). The idea is to a table with a UUID column so QuestDB knows it’s a UUID and use it for optimizations.
here is the Pull Request: https://github.com/questdb/questdb/pull/2769 once that’s merged then the nightly build will start supporting UUID.
c

Chris

01/11/2023, 4:21 PM
@Jaromir Hamala thats terrific. I understand completely - I did a search in docs to see if UUID were an official type and had I not found that announcement I prob would have just cast it as a string but still used it
Is it an "official" uuid version like v4?
Also, is the change just adding the type? I'd be interested to see if we could send our own UUIDs and/or have one generated as well for each row
Having both options would be great
j

Jaromir Hamala

01/11/2023, 4:24 PM
you can store any version you want. from a database perspective a UUID is just 128 bits of data. versions matter if you want QuestDB to generate UUIDs on your behalf. the PR is introducing a function
rnd_uuid4()
which return a new UUID v4.
it’s adding the new type and functions like the
rnd_uuid4()
feedback and feature requests are welcome and appreciated so if there is a function you would like to see that I’m all ears! 🙂 also: one goal is that a UUID column should be usable everywhere where a String column is usable. this means QuestDB will do implicit casting from UUID to String when needed - again, to simplify transitions from the String type to UUID.
Hello @Chris 6.7 has been released (an announcement will follow soon) so you can try the new UUID type. https://questdb.io/docs/reference/sql/datatypes/#the-uuid-type all feedback is very much appreciated!