3 ms·
Bit of both. Previously, you could indicate you wanted an index on a field, but only on a single field, and you did it in the field definition. Declaring them
by ubernostrum 10y ago
Bit of both.
Previously, you could indicate you wanted an index on a field, but only on a single field, and you did it in the field definition.
Declaring them in Meta via the Index class is new, as is the multi-field support and direction support. More importantly, you can subclass Index to define other types of indices besides the default (which is btree). For example, Django now ships built-in subclasses to do BRIN and GIN on Postgres.
- deckiedan 10y agoIs there anywhere django docs on how to actually use the brin/gin indexes? All I can find is that they exist...
- rattray 10y agohttps://docs.djangoproject.com/en/1.11/ref/contrib/postgres/indexes/#module-django.contrib.postgres.indexes https://docs.djangoproject.com/en/1.11/ref/contrib/postgres/...
- minusf 10y agosingle field? what about `unique_together` and `index_together`?