Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

There was a problem

You must be a member of this account.

This project is archived and is in readonly mode.

validate_uniqueness_of and case insensitive columns ...

#1759

As far as I've seen, the case_sensitive_equality_operator is in rails 2.2 bound to the connection adapter. But why is the more expensive case insensitve case not handled in a connection adapter bound way? On mysql an complete table-scan will run if someone compares by using lower() = . The result would be the same, if not using lower... in my freezed checkout of rails 1.x there was a comment, that this is anyway only needed by sqlite.. so why don't write a adapter specific method here as well? I had a lot of trouble on my project, searching for the bottleneck, until I found this out...

Reported by nerd · January 14th, 2009 @ 12:42 PM

State: duplicate
Milestone: 2.x
Assigned to: Pratik Pratik
Importance: none

Activity

  1. Pratik
    Pratik
    • Assigned user set to Pratik

    Didn't know about LOWER(). Do you want to work on a patch for this ?

    March 14th, 2009 @ 03:50 PM

  2. CancelProfileIsBroken
    CancelProfileIsBroken
    • State changed from new to duplicate

    If we take the patch in #2503 validates_uniqueness_of is horribly inefficient in mysql, this will be fixed. Closing so we can concentrate on work there.

    August 8th, 2009 @ 01:17 PM