In this rails 3.2 app, New Relic is showing location#find is taking a lot
of time from a particular controller method. I have users & locations;
location belongs to user. the user_id column is indexed, and there is a
"timestamp" column which is also indexed. I recently added a column called
"lastreport" which is also a date time field but not indexed. The resulting
query filters on user_id, and timestamp, and where timestamp + interval is
less than or equal to lastreport. Should I create a composite index on all
3 columns? Is adding an index on just "lastreport" enough?

This is causing me grief today. Any help is appreciated.

Thanks,
Josh

-- 
You received this message because you are subscribed to the Google
Groups "Heroku" group.

To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/heroku?hl=en_US?hl=en

Reply via email to