Okay, found the answer. We are using Solr, and frontend is querying solr 
which is converting the mysql query and taking a lot of time to run.

-- 
Posted via http://www.ruby-forum.com/.