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?

  Contact Load (0.001406)   SELECT * FROM `contacts` WHERE
(`contacts`.user_id = 1)
  Phone Load (0.003268)   SELECT * FROM `phones` WHERE
(`phones`.contact_id = 8485)
  Email Load (0.000371)   SELECT * FROM `emails` WHERE
(`emails`.contact_id = 8485)
  Note Load (0.019782)   SELECT * FROM `notes` WHERE (`notes`.contact_id
= 8485)
  Group Load (0.000154)   SELECT `groups`.* FROM `groups` INNER JOIN
groupers ON groups.id = groupers.group_id WHERE ((`groupers`.contact_id
= 8486))

a Contact has_many phones, emails, notes.
a Contact has_many groups :through groupers

Thanks much, and thanks even more if you include some explanation!

thanks,
jp
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to