#23797: SQL generated for negated F() expressions is incorrect -------------------------------------+------------------------------------- Reporter: mssnlayam | Owner: nobody Type: Bug | Status: new Component: Database layer | Version: 1.7 (models, ORM) | Resolution: Severity: Normal | Triage Stage: Accepted Keywords: | Needs documentation: 0 Has patch: 0 | Patch needs improvement: 0 Needs tests: 0 | UI/UX: 0 Easy pickings: 0 | -------------------------------------+-------------------------------------
Comment (by akaariai): After a quick test, it seems the `WHERE ("testapp_rectangle"."length" = ("testapp_rectangle"."width")) IS NOT true` approach will not work that well. At least PostgreSQL wont use indexes for a query `select * from foobar where (id > 1 and id < 20) is true`, but will use the index for `select * from foobar where (id > 1 and id < 20)`. This tells me PostgreSQL's optimizer will not handle the is true / is not true conditions well. If somebody is able to provide a somewhat clean solution to this, I am all for fixing this. -- Ticket URL: <https://code.djangoproject.com/ticket/23797#comment:2> 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/067.39ca8a8a4a8d503cb7c9a65d9665bbf8%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.