Reputation: 1063
I am reading this documentation and it says you should add indexes to fields that you frequently query using filter()
, exclude()
, order_by()
.
I agree with the statement, but will this addition really help if there is no index on the actual database?
Upvotes: 0
Views: 349
Reputation: 137215
Adding db_index = True
to a field and then running makemigrations
will generate a migration that adds an appropriate index to your database when applied.
Upvotes: 3