From: Peter Szinek Date: 2008-11-13T03:41:55+09:00 Subject: Re: Convert text string i.e 'Peter' into integer ID > I will try to optimize the table indexing the headline field as > suggested. One question regarding this: Can this be done from rails or > are these mysql commands ('CREATE INDEX' etc.)? Yeah, you can do it from Rails migrations: http://apidock.com/rails/ActiveRecord/Migration, section 'Available transformations': add_index(table_name, column_names, options): Adds a new index with the name of the column. Other options include :name and :unique (e.g. { :name => "users_name_index", :unique => true }). Cheers, Peter