#34107: Django ORM queries do not pick up indexes made on a key in JSONField in
Postgres
-------------------------------------+-------------------------------------
Reporter: Tadek Teleżyński | Owner: nobody
Type: Bug | Status: closed
Component: Database layer | Version: 3.2
(models, ORM) |
Severity: Normal | Resolution: invalid
Keywords: json, jsonfield, | Triage Stage:
postgres, index | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Tadek Teleżyński):
Replying to [comment:3 Mariusz Felisiak]:
> By the way, have you tried to create these indexes via `Meta.indexes`?
You can create them
[https://docs.djangoproject.com/en/4.1/ref/contrib/postgres/operations
/#concurrent-index-operations concurrently] without writing raw SQLs.
I couldn't figure out a syntax for the {{{fields}}} key when I want to do
an index on a key inside the json structure.
{{{
BTreeIndex(fields=['data__category'])
}}}
won't do...
--
Ticket URL: <https://code.djangoproject.com/ticket/34107#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/01070183f1319906-a4c3738e-b2f4-453f-9645-f05baa47254e-000000%40eu-central-1.amazonses.com.