Downside of using shortuuid as primary key

31 views
Skip to first unread message

Suren Sth

unread,
Oct 27, 2016, 12:34:14 AM10/27/16
to Django users
I am considering to use shortuuid as the primary key for my models.

Is there any downside to this?
Does it severely affect db indexing?

Avraham Serour

unread,
Oct 27, 2016, 5:04:46 AM10/27/16
to django-users
why are you considering?


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a569e980-8a02-469d-95ff-74d87beae13a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bruno A.

unread,
Oct 27, 2016, 9:28:44 AM10/27/16
to Django users
Hi,

I've inherited a project where a core model was done like this, and let me tell you right away: don't do this

The performances don't seem too much affected (see comment below the answer), but I do know there are a few limitations that come with it, and changing it later is not a straightforward operation. The first limitation that comes to my mind is with GenericForeignKey. It expects the object ID to be an integer. Even if you don't use that feature directly, some libraries that you might need, will, and you'll be blocked from using them.
Reply all
Reply to author
Forward
0 new messages