#29482: simplify KeyTransform to always use the 'nested_operator' --------------------------------+-------------------------------------- Reporter: David De Sousa | Owner: nobody Type: Uncategorized | Status: new Component: Uncategorized | Version: 2.0 Severity: Normal | Resolution: Keywords: | Triage Stage: Unreviewed Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 --------------------------------+--------------------------------------
Comment (by David De Sousa): Replying to [comment:1 Simon Charette]: > From my understanding the `->` and `->>` operators are used instead of their `#` variant when the key lookup depth is 1 for readability purposes. > > Is there a reason you can't create your non-nested attribute lookups using the `->` and `->>` operators instead? Are you suggesting we favor the `#` syntax because a functional index on `data#>'{a,b}'` would be used when doing a `data#>'{a}'` lookup? No, that won't happen AFAIK > > I'm asking because changing it at this point is likely to break any previously created functional index created using these operators for the same reason you are asking them to be changed here. I assume this is something that would eventually be fixed in PostgreSQL. It would be awesome if PostgreSQL dealt with this, but I asked in the #postgres IRC and was told there's no way for the query planner to do this, although I got confirmation the `#` and `-` operators are equivalent. No, the issue is that django uses both operators based on if it's a root key or a nested one, I agree a change here would potentially break previously created indexes using the `->` or `-->` operators, so developers should take this into consideration when building indexes, it should at least be documented, I found out the hard way. -- Ticket URL: <https://code.djangoproject.com/ticket/29482#comment:3> 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 django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/063.92daeb6b92ec7704a9f4792c84b94be7%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.