Changes between Initial Version and Version 1 of Ticket #28038, comment 3


Ignore:
Timestamp:
Apr 6, 2017, 7:50:34 PM (8 years ago)
Author:
Simon Charette

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #28038, comment 3

    initial v1  
    11It'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.
    22
    3 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.
     3I 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('lookup'))` on small datasets or relying on a [http://stackoverflow.com/a/16019599/70191 GIN indexed functional lookup instead] on large ones.
    44
    55Anyway, here's the [https://github.com/django/django/pull/8317 PR].
Back to Top