Indexes for very large tables

Yeah, basically that.

Field.db_index is “soft deprecated”, with the docs saying:

Where possible, use the Meta.indexes option instead. In nearly all cases, indexes provides more functionality than db_index. db_index may be deprecated in the future.

However, there has been some debate around whether this will actually go ahead: (Soft-)deprecating `Field.unique` . Creating a ForeignKey with db_index=False is sometimes necessary.


Another thing that I know at least one project does is linting the SQL of migration files, via sqlmigrate, to check for ADD INDEX statements without CONCURRENTLY, among other things. That gives you a stronger guarantee, as it checks what Django is doing under the hood.