On 4 Oct 2011, at 9:19 AM, Jonas H. wrote:
> On 10/04/2011 05:51 PM, Ted Gruenloh wrote:
>> The django online documentation mentions that the SQL equivalent for
>> __icontains is something like:
>>
>> SELECT ... WHERE headline ILIKE '%Lennon%';
>> However, for postgresql - one of the dbs that actually supports ILIKE - I
>> noticed __icontains was actually performing something similar to:
>> SELECT ... WHERE LOWER(headline) LIKE LOWER('%Lennon%');
>>
>> The ILIKE is obviously much faster [...]
>
> https://code.djangoproject.com/ticket/3575
Though apparently pg 9.1's trigram indexes can be used for ILIKE searches (but
aren't a win for all query patterns). It seems to me it'd be worthwhile to have
a setting to tell the backend whether to use ILIKE vs. LIKE LOWER, though
personally I'm not using __icontains so I don't have a dog in this fight :)
--
You received this message because you are subscribed to the Google Groups
"Django developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-developers?hl=en.