You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Basically, creating a foreignkey field does not create a database index, even if db_index=True is specified. The workaround described above is to make a RunSQL migration to manually create the index for every field, but it would be better to respect the db_index argument.
I am using cockroachdb 22.1.22 and django-cockroachdb==3.2.2.
Thanks!
The text was updated successfully, but these errors were encountered:
This is because ForeignKey defaults to db_index=True. That makes sense on databases where foreign keys are automatically indexed, but not for CockroachDB.
I'm experiencing the same problem described in this blog post: https://mathieulamiot.com/my-feedbacks-on-using-cockroachdb-for-a-data-intensive-django-service/
Basically, creating a foreignkey field does not create a database index, even if
db_index=True
is specified. The workaround described above is to make a RunSQL migration to manually create the index for every field, but it would be better to respect the db_index argument.I am using cockroachdb 22.1.22 and django-cockroachdb==3.2.2.
Thanks!
The text was updated successfully, but these errors were encountered: