#3575: [patch] iexact searches should use LOWER() not ILIKE
----------------------------------------------+-----------------------------
Reporter:  Jack Moffitt <[EMAIL PROTECTED]>  |       Owner:  adrian          
  Status:  new                                |   Component:  Database wrapper
 Version:  SVN                                |    Keywords:                  
   Stage:  Unreviewed                         |   Has_patch:  1               
----------------------------------------------+-----------------------------
 Currently queries using field__iexact="blah" translate to field ILIKE
 'blah'.  This is really inefficient because ILIKE queries (since they are
 for pattern matching) cannot be indexed and the whole table must be
 scanned.  If LOWER(field) = LOWER('blah') is used, it accomplishes the
 same thing, but an index can be created for LOWER(field) that eliminates
 the table scan.
 
 This is a little tricky since the default substitution is only on the
 operator and the right operand, but this patch adds a column substitution
 array as well.  This patch should probably be applied across all backends
 where LOWER() is supported.  Currently it only changes the
 postgresql_psycopg2 backend.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/3575>
Django Code <http://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 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-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to