I just want to be on the safe side. I have this models:
class Player(models.Model):
name = models.CharField(max_length=64, db_index=True)
...
class Match(models.Model):
date = models.DateField()
playerA = models.ForeignKey(Player, related_name='playerA') # neither here db_index
playerB = models.ForeignKey(Player, related_name='playerB') # nor here db_index
...
Is the usage of db_index correct? And, there is no need to add extra indexes to either playerA or playerB?
db_indexwon't case errors if that's what you mean, otherwise what is your question?playerAandplayerBfilters, or do I have to additionally setdb_indexonplayerAandplayerBfields in the model?