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
Fixed #28423 -- Updated index docs for JSONField, HStoreField and Arr… #9001
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unsure if repeating a similar thing three times is best approach or if a shared section would be better.
docs/ref/contrib/postgres/fields.txt
Outdated
``btree`` index. This does not offer particularly significant help to querying. | ||
A more useful index is a ``GIN`` index, which you should create using a | ||
:class:`~django.db.migrations.operations.RunSQL` operation. | ||
In addition to a :class:`~django.db.models.Index` or |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
an Index
docs/ref/contrib/postgres/fields.txt
Outdated
In addition to a :class:`~django.db.models.Index` or | ||
:attr:`~django.db.models.Field.db_index` which will create a ``btree`` | ||
index, ``ArrayField`` can be indexed using | ||
:class:`~django.contrib.postgres.indexes.GinIndex` or a ``gist`` index |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a gist index. The latter can be implemented with an class:~django.db.models.Index
subclass.
We lost the advice about "This does not offer particularly significant help to querying." with regards to btree indexes. Can you give similar advice for other fields? |
@timgraham Yes, I'll adjust it this week. I think a common section in the bottom (or top) would be fine. |
d655a1d
to
fd1f487
Compare
Here's a version with some edits:
I don't have expertise here, but I was reading https://www.postgresql.org/docs/current/static/datatype-json.html and it seems like we should avoid making strong general recommendations (hence wording like "may be"). |
Mads, what do you think about the proposed wording? |
fd1f487
to
49d8499
Compare
LGTM. Sorry for the late follow-up. I'll push it. I was considering whether a reference to https://www.postgresql.org/docs/current/static/textsearch-indexes.html would be an idea, but it's in a chapter targeting full-text search. |
49d8499
to
fea3979
Compare
Shouldn't we do a backport of this to 1.11? I think it's just a matter of rephrasing the gist reference to a class-based index. "and a gist index are better suited ... The latter can be implemented with an class: |
I don't think it's particularly critical but if you want to send a PR, I'm okay to merge it. At some point (after the release of Django 2.0, I guess), the 1.11 docs are frozen except for really critical fixes. In part, that's so that we don't introduce untranslated text into the translated docs. Only the "stable" documentation receives translation updates. |
…ayField
Would it be considerable to backport this to 1.11? Both
GinIndex
and the class-based indexes were introduced in that release.https://code.djangoproject.com/ticket/28423