On Aug 14, 2012, at 10:46 AM, Jonathan Vanasco wrote:

> also, just to clarify - i didn't want a case insensitive compare but a
> specific sql generated
> 
> just to give a quick illustration
> 
> With this table structure:
> 
>    CREATE TABLE names (
>      id serial not null primary key ,
>      name varchar(255) not null
>    );
>    CREATE UNIQUE INDEX names_name_uidx ON names(lower(name));
> 
> Postgres and Oracle will optimize this search against the index:
>    """SELECT * FROM names WHERE lower(name) = '%s'""" %
> search.lower()
> 
> Doing an ilike or similar won't work -- while the effect is a "case
> insensitive search", the search is actually case sensitive.
> 
> The nice things about function based indexes like this, is that you
> can both preserve uniqueness on a string ( usernames, email addresses,
> etc ) and also gain a little speed on your most often used lookups.


in 0.8 you'll be able to add whatever functions and operators to Column and 
friends that you'd like, specific to types.    All three email threads I dealt 
with yesterday regarded the ability to associate new operators with types so 
that feature has been added as of yesterday, just needs more docs.



-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to