I was doing some Index analysis on my Platform and noticed AccessAttempt has a redundant index on username as already covered by unique_together = ("username", "ip_address", "user_agent").
I know it's pretty much nothing and probably micro-optimization but if you want i can create a PR fix it.
Mainly consist on adding:
username = models.CharField(_("Username"), max_length=255, null=True)`
to the model AccessAttempt to overide username without db_index=True.
Migration generated by this fix
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("axes", "0010_accessattemptexpiration"),
]
operations = [
migrations.AlterField(
model_name="accessattempt",
name="username",
field=models.CharField(max_length=255, null=True, verbose_name="Username"),
),
]
NB: I use PostgreSQL and don't have the knowledge on other Database behavior
I was doing some Index analysis on my Platform and noticed AccessAttempt has a redundant index on
usernameas already covered by unique_together = ("username", "ip_address", "user_agent").I know it's pretty much nothing and probably micro-optimization but if you want i can create a PR fix it.
Mainly consist on adding:
to the model AccessAttempt to overide
usernamewithoutdb_index=True.Migration generated by this fix
NB: I use PostgreSQL and don't have the knowledge on other Database behavior