[Django] #31785: Documentation suggesting using UUIDField as a good alternative for primary_key, without inviting to consider performance drawbacks

8 views
Skip to first unread message

Django

unread,
Jul 14, 2020, 12:24:18 AM7/14/20
to django-...@googlegroups.com
#31785: Documentation suggesting using UUIDField as a good alternative for
primary_key, without inviting to consider performance drawbacks
-------------------------------------+-------------------------------------
Reporter: Remy | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: | Version: 3.0
Documentation |
Severity: Normal | Keywords: uuid uuidfield
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
In the documentation section regarding UUIDFields
([https://docs.djangoproject.com/en/3.0/ref/models/fields/#uuidfield]), we
have:


{{{
Universally unique identifiers are a good alternative to AutoField for
primary_key
}}}

However the question of whether UUIDs make good primary keys regarding to
performance appears to be debated: https://www.percona.com/blog/2019/11/22
/uuids-are-popular-but-bad-for-performance-lets-discuss/

What is the take of the community regarding that?

In any case if there is doubt, having mention of that in the documentation
should be considered.

--
Ticket URL: <https://code.djangoproject.com/ticket/31785>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jul 14, 2020, 2:18:51 AM7/14/20
to django-...@googlegroups.com
#31785: Documentation suggesting using UUIDField as a good alternative for
primary_key, without inviting to consider performance drawbacks
-------------------------------------+-------------------------------------
Reporter: Remy | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: Documentation | Version: 3.0
Severity: Normal | Resolution: invalid

Keywords: uuid uuidfield | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* status: new => closed
* resolution: => invalid


Comment:

> What is the take of the community regarding that?

The DevelopersMailingList is the appropriate venue for this kind of
question/discussion.

There was some discussion of this here: https://groups.google.com/d/topic
/django-developers/VFXZpHnuEJc/discussion which led to #31007.

I cannot recall exactly what the consensus opinion on using UUID PKs was.
(I've certainly done it in the past without experiencing particular issues
but...)

Will close as invalid for now, since the mailing list is the place for it,
but happy to re-open/accept if there's a consensus reached.
Thanks.

--
Ticket URL: <https://code.djangoproject.com/ticket/31785#comment:1>

Reply all
Reply to author
Forward
0 new messages