id,summary,reporter,owner,description,type,status,component,version,severity,resolution,keywords,cc,stage,has_patch,needs_docs,needs_tests,needs_better_patch,easy,ui_ux 29482,simplify KeyTransform to always use the 'nested_operator',David De Sousa,nobody,"Currently, the `KeyTransform` and `KeyTextTransform` classes in the JSONB Field lookups are making a distinction in the way the query is being generated based on the depth of the key inside the JSON, using a different operator depending on if the key is in the root of the json or not. This is an issue specially if you create indexes based on jsonb traversals, for some reason if you create an index with the path operators (#> or #>>) and then query with the ""regular"" operators (-> or ->>) the indexes are not always used. I've tested removing the use of the `operator` and basically just leaving the return in https://github.com/django/django/blob/2.0.6/django/contrib/postgres/fields/jsonb.py#L105 as the only return in the function and it works for me, I'd be happy to create a PR but I don't know if that distinction is there for a reason.",Cleanup/optimization,closed,contrib.postgres,2.0,Normal,wontfix,,James Howe,Unreviewed,0,0,0,0,0,0