Rails efficiency of where clause

performance, ruby-on-rails, ruby-on-rails-3, where-clause

Solution

It just fires this query,

select * from posts where title = params[:title]

You can index the title column in your migration file

add_index(:posts, :title)

Problem

I'm worried about the efficiency of this line in the controller of my Rails project ``` posts_list = Post.where(:title => params[:title]) ``` If the number of "Posts" in the database grows, will the line become slow to execute? Is there any possible optimization?

Original source