On Thursday, 30 November, 2017 09:27, J Decker <d3c...@gmail.com> wrote:

>> UUIDs are nice though if you don't have a natural key available and
>> you are generating keys on multiple systems. Sadly, they are strings
>> in sqlite, and  it would be more efficient to store and compare them 
>> as their 128-bit representation. Is there an extension that can do 
>> that?

Just store them as a 16-byte blob.  What's the problem?

>I would also like to make a note, that many criticisms are 'there's
>so many bytes to have to compare', however, because of the highly 
>random nature of good UUIDs failure occurs quickly, usually within 
>4 bytes, which makes it almost as good as an integer 

Or just use randomblob(16) ...

>(especialy for things like SQLite that are comparing numbers as 
>strings anyway).... the only time the full thing is compared is 
>on the row that exactly matches.

I do not know what version of SQLite3 you are using, but according
to the source code, only strings are compared as strings.  Everything
else is compared using the appropriate Affinity -- Double to Double,
Integer to Integer, BLOB to BLOB, etc.

The fact that there's a Highway to Hell but only a Stairway to Heaven says a 
lot about anticipated traffic volume.

sqlite-users mailing list

Reply via email to