-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Best practices for index USING HASH (...or USING HASH WITH BUCKET_COUNT) ? #264
Comments
I wonder if https://docs.djangoproject.com/en/4.1/ref/contrib/postgres/indexes/#hashindex would work, at least for the secondary indexes. |
Yeah, interesting find @ajwerner I've noticed any modifications I do to |
Ideal situation is this becomes a Primary Key option- the most common use case. Although I'd be okay with this just being default as discussed in the ticket over on the main cockroach repo.. The default here is already |
Temporary solution that works: #BigAutoField='DEFAULT unique_rowid()',
BigAutoField='USING HASH DEFAULT unique_rowid()', @timgraham This will use the default hash bucket count of 16, which is a nice, sane default. I'm too new to Django to dive into more advanced topics such as new Field types (if it is necessary?), and am hoping you can take this the rest of the way. |
Yes, a new
The downsides are:
|
This is about CRDB's hash sharded index feature for sequential indexes / primary keys: https://www.cockroachlabs.com/blog/hash-sharded-indexes-unlock-linear-scaling-for-sequential-workloads/
Is there any way to use this feature?
I've tried passing various arguments to
_create_index_sql()
:condition=
include=
db_tablespace=
expressions=
With no success.
It may require an extra entry in https://github.com/cockroachdb/django-cockroachdb/blob/master/django_cockroachdb/schema.py to handle this use case?
Any comments, thoughts, appreciated.
The text was updated successfully, but these errors were encountered: