What are the downsides of default ordering by PK in Django?
Django models now support default ordering, via Meta.ordering. What are the downsides to putting ordering = ["pk"]
on my base model?
In particular, I'm curious about the performance impact. The Django docs have a vague warning that this can hurt performance:
Ordering is not free; each field to order by is an operation the database must perform. If a model has a default ordering (Meta.ordering) and you don’t need it, remove it on a QuerySet by calling order_by() with no parameters.
But is ordering by the primary key actually expensive if I'm using Postgres as my database?