Is Django automatically generating indexes for foreign keys or is it dependent only on the underlying database policy?
Django automatically creates an index for all models.ForeignKey columns.
models.ForeignKey
From the Django Documentation :
The database index is automatically created on ForeignKey . You can disable this by setting db_index to False . You can avoid the overhead of an index by creating a foreign key for consistency rather than joining, or if you create an alternative index, such as partial or multiple columns.
ForeignKey
db_index
False