Skip to main content
Participant
June 7, 2006
Question

When to use UUID

  • June 7, 2006
  • 1 reply
  • 367 views
I use MYSQL, but I think this is a general database design question:

Is it a good idea to use CreateUUID to generate field data for unique indexes and primary keys? I don't know an awful lot about the performance aspect of databases and I'm concerned that using keys and indexes that are 35 characters long, will waste disk space and processing time.

If I did use UUIDs, would Partial indexing be the best way to handle them?

This topic has been closed for replies.

1 reply

Inspiring
June 7, 2006
ColdFusion's UUID is overkill for many database needs. The majority of the time, if you need to generate a new series of numbers to act as unique id for a table, you'll want to have the database do that for you by adding a identity column to the table.

The UUID is meant to be unique over a network, which is why it's so large. The records in your table need only be unique in that table so you don't need such a long number. It would be wasteful in terms of storage, memory, bandwidth and would be hard for humans to deal with when they need to.