On Dec 20, 1:01 am, Jeff Pritchard <[email protected]> wrote: > Hi, > I don't quite understand the syntax for database indexes and/or how the > work to help speed up specific database searches. Can somebody suggest > a set of indexs that would make this set of queries go faster? [...]
Very simple: you can profit by indexing on almost anything you're going to be doing a lot of searching on. In this case, that means that you should consider building indices on your foreign key fields (such as contacts.user_id), since they're what you're searching on in these queries. But before you do that, you might want to try EXPLAIN SELECT on the queries you're interested in, and see what mySQL tells you about where the bottlenecks are. Best, -- Marnen Laibow-Koser [email protected] http://www.marnen.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

