#28038: Cast regression in PostgresSQL using built-in lookups
-------------------------------------+-------------------------------------
     Reporter:  Peter J. Farrell     |                    Owner:  (none)
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  1.11
  (models, ORM)                      |
     Severity:  Release blocker      |               Resolution:
     Keywords:  postgres postgresql  |             Triage Stage:  Accepted
  array_agg                          |
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Simon Charette):

 * owner:  Simon Charette => (none)
 * status:  assigned => new
 * has_patch:  0 => 1
 * severity:  Normal => Release blocker
 * stage:  Unreviewed => Accepted


Comment:

 It's a shame we expose builtin lookups such as `__icontains` on these kind
 of fields as it produces really inefficient SQL, a real footgun API if you
 ask me.

 I think we'd be doing developers a favor in erroring instead and forcing
 them to choose an implementation that best fit their need. That is using
 something along `EXISTS(SELECT 1 FROM unnest(array_field) key WHERE
 UPPER(key) = UPPER(key))` on small datasets or relying on a
 [http://stackoverflow.com/a/16019599/70191 GIN indexed functional lookup
 instead] on large ones.

 Anyway, here's the [https://github.com/django/django/pull/8317 PR].

--
Ticket URL: <https://code.djangoproject.com/ticket/28038#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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.ee60b93b96f5a57580b8b0f64d77cc4e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to