I have a custom user model that takes in the following fields:
class MyUser(AbstractBaseUser, PermissionsMixin):
username = models.CharField(max_length=60, unique=True)
email = models.EmailField(max_length=120, unique=True)
full_name = models.CharField(max_length=50, blank=True)
is_active = models.BooleanField(default=True)
I know username and email automatically adds a db_index because it is set to unique=True.
Does it make sense to add db_index=True for my full_name and is_active fields?
I have a search feature that checks if the regex matches the full_name. In my model managers, I also filter against is_active=True.
I would like to optimize querys, but don't want to add tables to my database if it isn't necessary.
Thank you!