zsombor/hashed_attribute
Speeds up string lookups by storing an SHA1 on the attribute content. The hash is updated automatically, lookups by a constant string value will append a condition on string itself. This helps avoiding the long key problem in MySQL, as well as keeping the lookups faster and evenly distributed compared to a partial prefix index.
RubyMIT