Changes between Initial Version and Version 21 of Ticket #3575


Ignore:
Timestamp:
06/30/2008 12:50:37 PM (7 years ago)
Author:
ramiro
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #3575

    • Property Cc sam@… added
    • Property Patch needs improvement set
    • Property Needs tests set
    • Property Summary changed from [patch] iexact searches should use LOWER() not ILIKE to postgres backend should optimize iexact searches
    • Property Owner changed from nobody to PhiR
    • Property Needs documentation unset
    • Property Triage Stage changed from Unreviewed to Accepted
  • Ticket #3575 – Description

    initial v21  
    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.
     1Currently 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.
    22
    33This 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.
Back to Top