Ok, so, I''ve written my first app in rails. It''s pretty
nifty. Only
one problem. Slower than you could possibly comprehend.
Processing PersonController#show (for 67.138.254.231 at Thu Mar 03
21:04:16 Eastern Standard Time 2005)
Parameters: {:id=>"1", :controller=>"person",
:action=>"show"}
[4;35mPerson Load (0.219000) [0;37mSELECT * FROM people WHERE
id = ''1'' LIMIT 1
[4;33mPerson Columns (0.203000) [1;37mSHOW FIELDS FROM people
Rendering person/show within layouts/xhtml11common
[4;35mAccount Load (0.203000) [0;37mSELECT * FROM accounts
WHERE service_id = 6 AND person_id = 1 LIMIT 1
[4;33mAccount Columns (0.234000) [1;37mSHOW FIELDS FROM accounts
[4;35mAccount Load (0.234000) [0;37mSELECT * FROM accounts
WHERE service_id = 6 AND person_id = 1 LIMIT 1
[4;33mAccount Load (0.234000) [1;37mSELECT * FROM accounts
WHERE service_id = 6 AND person_id = 1 LIMIT 1
[4;35mNickname Load (0.219000) [0;37mSELECT * FROM nicknames
WHERE person_id = 1
[4;33mNickname Columns (0.203000) [1;37mSHOW FIELDS FROM nicknames
[4;35mPhonenumber Load (0.219000) [0;37mSELECT * FROM
phonenumbers WHERE person_id = 1
[4;33mPhonenumber Columns (0.219000) [1;37mSHOW FIELDS FROM
phonenumbers
[4;35mAccount Load (0.203000) [0;37mSELECT * FROM accounts
WHERE service_id = 6 AND person_id = 1 LIMIT 1
[4;33mAccount Load (0.234000) [1;37mSELECT * FROM accounts
WHERE service_id = 6 AND person_id = 1 LIMIT 1
[4;35mAccount Load (0.125000) [0;37mSELECT * FROM accounts
WHERE service_id = 6 AND person_id = 1 LIMIT 1
[4;33mAccount Load (0.125000) [1;37mSELECT * FROM accounts
WHERE service_id = 6 AND person_id = 1 LIMIT 1
[4;35mAccount Load (0.266000) [0;37mSELECT * FROM accounts
WHERE service_id = 6 AND person_id = 1 LIMIT 1
[4;33mAccount Load (0.110000) [1;37mSELECT * FROM accounts
WHERE service_id = 6 AND person_id = 1 LIMIT 1
[4;35mAccount Load (0.109000) [0;37mSELECT * FROM accounts
WHERE service_id = 6 AND person_id = 1 LIMIT 1
[4;33mAccount Load (0.125000) [1;37mSELECT * FROM accounts
WHERE service_id = 6 AND person_id = 1 LIMIT 1
[4;35mAccount Count (0.110000) [0;37mSELECT COUNT(*) FROM
accounts WHERE person_id = 1
[4;33mAccount Load (0.140000) [1;37mSELECT * FROM accounts
WHERE person_id = 1
[4;35mInterest Load (0.125000) [0;37mSELECT t.*, j.* FROM
interests_people j, interests t WHERE t.id = j.interest_id AND
j.person_id = 1 ORDER BY t.id
[4;33mService Load (0.110000) [1;37mSELECT * FROM services
WHERE id = 5 LIMIT 1
[4;35mService Columns (0.110000) [0;37mSHOW FIELDS FROM services
[4;33mAccount Count (0.109000) [1;37mSELECT COUNT(*) FROM
accounts WHERE service_id = 5
[4;35mAccount Load (0.109000) [0;37mSELECT * FROM accounts
WHERE service_id = 5
[4;33mService Load (0.110000) [1;37mSELECT * FROM services
WHERE id = 2 LIMIT 1
[4;35mAccount Count (0.125000) [0;37mSELECT COUNT(*) FROM
accounts WHERE service_id = 2
[4;33mAccount Load (0.109000) [1;37mSELECT * FROM accounts
WHERE service_id = 2
[4;35mService Load (0.109000) [0;37mSELECT * FROM services
WHERE id = 1 LIMIT 1
[4;33mAccount Count (0.110000) [1;37mSELECT COUNT(*) FROM
accounts WHERE service_id = 1
[4;35mAccount Load (0.109000) [0;37mSELECT * FROM accounts
WHERE service_id = 1
[4;33mService Load (0.109000) [1;37mSELECT * FROM services
WHERE id = 7 LIMIT 1
[4;35mAccount Count (0.110000) [0;37mSELECT COUNT(*) FROM
accounts WHERE service_id = 7
[4;33mAccount Load (0.125000) [1;37mSELECT * FROM accounts
WHERE service_id = 7
[4;35mService Load (0.109000) [0;37mSELECT * FROM services
WHERE id = 8 LIMIT 1
[4;33mAccount Count (0.109000) [1;37mSELECT COUNT(*) FROM
accounts WHERE service_id = 8
[4;35mAccount Load (0.125000) [0;37mSELECT * FROM accounts
WHERE service_id = 8
[4;33mService Load (0.110000) [1;37mSELECT * FROM services
WHERE id = 4 LIMIT 1
[4;35mAccount Count (0.109000) [0;37mSELECT COUNT(*) FROM
accounts WHERE service_id = 4
[4;33mAccount Load (0.156000) [1;37mSELECT * FROM accounts
WHERE service_id = 4
[4;35mService Load (0.109000) [0;37mSELECT * FROM services
WHERE id = 6 LIMIT 1
[4;33mAccount Count (0.110000) [1;37mSELECT COUNT(*) FROM
accounts WHERE service_id = 6
[4;35mAccount Load (0.172000) [0;37mSELECT * FROM accounts
WHERE service_id = 6
[4;33mService Load (0.125000) [1;37mSELECT * FROM services
WHERE id = 3 LIMIT 1
[4;35mAccount Count (0.109000) [0;37mSELECT COUNT(*) FROM
accounts WHERE service_id = 3
[4;33mAccount Load (0.141000) [1;37mSELECT * FROM accounts
WHERE service_id = 3
[4;35mService Load (0.156000) [0;37mSELECT * FROM services
WHERE id = 9 LIMIT 1
[4;33mAccount Count (0.219000) [1;37mSELECT COUNT(*) FROM
accounts WHERE service_id = 9
[4;35mAccount Load (0.203000) [0;37mSELECT * FROM accounts
WHERE service_id = 9
[4;33mService Load (0.218000) [1;37mSELECT * FROM services
WHERE id = 10 LIMIT 1
[4;35mAccount Count (0.204000) [0;37mSELECT COUNT(*) FROM
accounts WHERE service_id = 10
[4;33mAccount Load (0.234000) [1;37mSELECT * FROM accounts
WHERE service_id = 10
[4;35mService Load (0.281000) [0;37mSELECT * FROM services
WHERE id = 11 LIMIT 1
[4;33mAccount Count (0.203000) [1;37mSELECT COUNT(*) FROM
accounts WHERE service_id = 11
[4;35mAccount Load (0.235000) [0;37mSELECT * FROM accounts
WHERE service_id = 11
[4;33mService Load (0.187000) [1;37mSELECT * FROM services
WHERE id = 12 LIMIT 1
[4;35mAccount Count (0.219000) [0;37mSELECT COUNT(*) FROM
accounts WHERE service_id = 12
[4;33mAccount Load (0.203000) [1;37mSELECT * FROM accounts
WHERE service_id = 12
[4;35mService Load (0.219000) [0;37mSELECT * FROM services
WHERE id = 13 LIMIT 1
[4;33mAccount Count (0.265000) [1;37mSELECT COUNT(*) FROM
accounts WHERE service_id = 13
[4;35mAccount Load (0.266000) [0;37mSELECT * FROM accounts
WHERE service_id = 13
[4;33mService Load (0.219000) [1;37mSELECT * FROM services
WHERE id = 14 LIMIT 1
[4;35mAccount Count (0.266000) [0;37mSELECT COUNT(*) FROM
accounts WHERE service_id = 14
[4;33mAccount Load (0.297000) [1;37mSELECT * FROM accounts
WHERE service_id = 14
[4;35mInterest Columns (0.234000) [0;37mSHOW FIELDS FROM interests
[4;33mPerson Load (0.234000) [1;37mSELECT t.*, j.* FROM
interests_people j, people t WHERE t.id = j.person_id AND
j.interest_id = 1 ORDER BY t.id
[4;35mPerson Load (0.297000) [0;37mSELECT t.*, j.* FROM
interests_people j, people t WHERE t.id = j.person_id AND
j.interest_id = 2 ORDER BY t.id
[4;33mPerson Load (0.203000) [1;37mSELECT t.*, j.* FROM
interests_people j, people t WHERE t.id = j.person_id AND
j.interest_id = 3 ORDER BY t.id
[4;35mPerson Load (0.406000) [0;37mSELECT t.*, j.* FROM
interests_people j, people t WHERE t.id = j.person_id AND
j.interest_id = 6 ORDER BY t.id
[4;33mPerson Load (0.219000) [1;37mSELECT t.*, j.* FROM
interests_people j, people t WHERE t.id = j.person_id AND
j.interest_id = 7 ORDER BY t.id
[4;35mPerson Load (0.281000) [0;37mSELECT t.*, j.* FROM
interests_people j, people t WHERE t.id = j.person_id AND
j.interest_id = 8 ORDER BY t.id
[4;33mSkill Count (0.297000) [1;37mSELECT COUNT(*) FROM
skills WHERE person_id = 1
[4;35mSkill Load (0.203000) [0;37mSELECT * FROM skills WHERE
person_id = 1
[4;33mSkill Columns (0.235000) [1;37mSHOW FIELDS FROM skills
[4;35mSkill Load (0.234000) [0;37mSELECT * FROM skills WHERE
name = ''Ruby''
[4;33mPerson Load (0.234000) [1;37mSELECT * FROM people WHERE
id = 1 LIMIT 1
[4;35mSkill Load (0.328000) [0;37mSELECT * FROM skills WHERE
name = ''Ruby''
[4;33mPerson Load (0.313000) [1;37mSELECT * FROM people WHERE
id = 1 LIMIT 1
[4;35mSkill Load (0.266000) [0;37mSELECT * FROM skills WHERE
name = ''Ruby''
[4;33mPerson Load (0.359000) [1;37mSELECT * FROM people WHERE
id = 1 LIMIT 1
[4;35mSkill Load (0.187000) [0;37mSELECT * FROM skills WHERE
name = ''PHP''
[4;33mPerson Load (0.235000) [1;37mSELECT * FROM people WHERE
id = 1 LIMIT 1
[4;35mSkill Load (0.203000) [0;37mSELECT * FROM skills WHERE
name = ''PHP''
[4;33mPerson Load (0.250000) [1;37mSELECT * FROM people WHERE
id = 1 LIMIT 1
[4;35mSkill Load (0.297000) [0;37mSELECT * FROM skills WHERE
name = ''PHP''
[4;33mPerson Load (0.234000) [1;37mSELECT * FROM people WHERE
id = 1 LIMIT 1
[4;35mSkill Load (0.891000) [0;37mSELECT * FROM skills WHERE
name = ''C#''
[4;33mPerson Load (0.125000) [1;37mSELECT * FROM people WHERE
id = 1 LIMIT 1
[4;35mSkill Load (0.125000) [0;37mSELECT * FROM skills WHERE
name = ''C#''
[4;33mPerson Load (0.125000) [1;37mSELECT * FROM people WHERE
id = 1 LIMIT 1
[4;35mSkill Load (0.140000) [0;37mSELECT * FROM skills WHERE
name = ''C#''
[4;33mPerson Load (0.125000) [1;37mSELECT * FROM people WHERE
id = 1 LIMIT 1
[4;35mSkill Load (0.172000) [0;37mSELECT * FROM skills WHERE
name = ''Java''
[4;33mPerson Load (0.125000) [1;37mSELECT * FROM people WHERE
id = 1 LIMIT 1
[4;35mPerson Load (0.203000) [0;37mSELECT * FROM people WHERE
id = 4 LIMIT 1
[4;33mSkill Load (0.219000) [1;37mSELECT * FROM skills WHERE
name = ''Java''
[4;35mPerson Load (0.141000) [0;37mSELECT * FROM people WHERE
id = 1 LIMIT 1
[4;33mPerson Load (0.219000) [1;37mSELECT * FROM people WHERE
id = 4 LIMIT 1
[4;35mSkill Load (0.187000) [0;37mSELECT * FROM skills WHERE
name = ''Java''
[4;33mPerson Load (0.156000) [1;37mSELECT * FROM people WHERE
id = 1 LIMIT 1
[4;35mPerson Load (0.125000) [0;37mSELECT * FROM people WHERE
id = 4 LIMIT 1
[4;33mSkill Load (0.110000) [1;37mSELECT * FROM skills WHERE
name = ''HTML''
[4;35mPerson Load (0.125000) [0;37mSELECT * FROM people WHERE
id = 1 LIMIT 1
[4;33mSkill Load (0.109000) [1;37mSELECT * FROM skills WHERE
name = ''HTML''
[4;35mPerson Load (0.125000) [0;37mSELECT * FROM people WHERE
id = 1 LIMIT 1
[4;33mSkill Load (0.109000) [1;37mSELECT * FROM skills WHERE
name = ''HTML''
[4;35mPerson Load (0.125000) [0;37mSELECT * FROM people WHERE
id = 1 LIMIT 1
[4;33mSkill Load (0.110000) [1;37mSELECT * FROM skills WHERE
name = ''Scheme''
[4;35mPerson Load (0.125000) [0;37mSELECT * FROM people WHERE
id = 1 LIMIT 1
[4;33mSkill Load (0.094000) [1;37mSELECT * FROM skills WHERE
name = ''Scheme''
[4;35mPerson Load (0.109000) [0;37mSELECT * FROM people WHERE
id = 1 LIMIT 1
[4;33mSkill Load (0.110000) [1;37mSELECT * FROM skills WHERE
name = ''Scheme''
[4;35mPerson Load (0.110000) [0;37mSELECT * FROM people WHERE
id = 1 LIMIT 1
[4;33mSkill Load (0.140000) [1;37mSELECT * FROM skills WHERE
name = ''JavaScript''
[4;35mPerson Load (0.125000) [0;37mSELECT * FROM people WHERE
id = 1 LIMIT 1
[4;33mSkill Load (0.547000) [1;37mSELECT * FROM skills WHERE
name = ''JavaScript''
[4;35mPerson Load (0.141000) [0;37mSELECT * FROM people WHERE
id = 1 LIMIT 1
[4;33mSkill Load (0.156000) [1;37mSELECT * FROM skills WHERE
name = ''JavaScript''
[4;35mPerson Load (0.125000) [0;37mSELECT * FROM people WHERE
id = 1 LIMIT 1
[4;33mSkill Load (0.109000) [1;37mSELECT * FROM skills WHERE
name = ''CSS''
[4;35mPerson Load (0.125000) [0;37mSELECT * FROM people WHERE
id = 1 LIMIT 1
[4;33mSkill Load (0.110000) [1;37mSELECT * FROM skills WHERE
name = ''CSS''
[4;35mPerson Load (0.125000) [0;37mSELECT * FROM people WHERE
id = 1 LIMIT 1
[4;33mSkill Load (0.109000) [1;37mSELECT * FROM skills WHERE
name = ''CSS''
[4;35mPerson Load (0.109000) [0;37mSELECT * FROM people WHERE
id = 1 LIMIT 1
[4;33mSkill Load (0.094000) [1;37mSELECT * FROM skills WHERE
name = ''SQL''
[4;35mPerson Load (0.125000) [0;37mSELECT * FROM people WHERE
id = 1 LIMIT 1
[4;33mSkill Load (0.109000) [1;37mSELECT * FROM skills WHERE
name = ''SQL''
[4;35mPerson Load (0.109000) [0;37mSELECT * FROM people WHERE
id = 1 LIMIT 1
[4;33mSkill Load (0.094000) [1;37mSELECT * FROM skills WHERE
name = ''SQL''
[4;35mPerson Load (0.203000) [0;37mSELECT * FROM people WHERE
id = 1 LIMIT 1
[4;33mPerson Load (0.141000) [1;37mSELECT people.* FROM
people JOIN relations ON relations.to_id = people.id WHERE
relations.from_id = 1 AND (relations.relationship = ''romantic''
OR
relations.relationship = ''friend'')
[4;35mPerson Load (0.140000) [0;37mSELECT people.* FROM
people JOIN relations ON relations.to_id = people.id WHERE
relations.from_id = 1 AND (relations.relationship = ''romantic''
OR
relations.relationship = ''friend'')
[4;33mPerson Load (0.422000) [1;37mSELECT people.* FROM
people JOIN relations ON relations.to_id = people.id WHERE
relations.from_id = 1 AND (relations.relationship = ''romantic''
OR
relations.relationship = ''friend'')
[4;35mRelation Load (0.125000) [0;37mSELECT * FROM relations
WHERE from_id = 1
[4;33mRelation Columns (0.484000) [1;37mSHOW FIELDS FROM relations
[4;35mRelation Load (0.188000) [0;37mSELECT * FROM relations
WHERE from_id = 2 and to_id = 1 LIMIT 1
[4;33mPerson Load (0.171000) [1;37mSELECT * FROM people WHERE
id = 2 LIMIT 1
[4;35mRelation Load (0.141000) [0;37mSELECT * FROM relations
WHERE from_id = 3 and to_id = 1 LIMIT 1
[4;33mPerson Load (0.109000) [1;37mSELECT * FROM people WHERE
id = 3 LIMIT 1
[4;35mRelation Load (0.110000) [0;37mSELECT * FROM relations
WHERE from_id = 4 and to_id = 1 LIMIT 1
[4;33mPerson Load (0.110000) [1;37mSELECT * FROM people WHERE
id = 4 LIMIT 1
[4;35mRelation Load (0.109000) [0;37mSELECT * FROM relations
WHERE from_id = 5 and to_id = 1 LIMIT 1
[4;33mPerson Load (0.125000) [1;37mSELECT * FROM people WHERE
id = 5 LIMIT 1
[4;35mRelation Load (0.110000) [0;37mSELECT * FROM relations
WHERE from_id = 6 and to_id = 1 LIMIT 1
[4;33mPerson Load (0.125000) [1;37mSELECT * FROM people WHERE
id = 6 LIMIT 1
[4;35mRelation Load (0.110000) [0;37mSELECT * FROM relations
WHERE from_id = 7 and to_id = 1 LIMIT 1
[4;33mPerson Load (0.125000) [1;37mSELECT * FROM people WHERE
id = 7 LIMIT 1
[4;35mRelation Load (0.171000) [0;37mSELECT * FROM relations
WHERE from_id = 21 and to_id = 1 LIMIT 1
[4;33mPerson Load (0.219000) [1;37mSELECT * FROM people WHERE
id = 21 LIMIT 1
[4;35mRelation Load (0.297000) [0;37mSELECT * FROM relations
WHERE from_id = 15 and to_id = 1 LIMIT 1
[4;33mPerson Load (0.219000) [1;37mSELECT * FROM people WHERE
id = 15 LIMIT 1
[4;35mRelation Load (0.203000) [0;37mSELECT * FROM relations
WHERE from_id = 19 and to_id = 1 LIMIT 1
[4;33mPerson Load (0.219000) [1;37mSELECT * FROM people WHERE
id = 19 LIMIT 1
[4;35mRelation Load (0.203000) [0;37mSELECT * FROM relations
WHERE from_id = 9 and to_id = 1 LIMIT 1
[4;33mPerson Load (0.234000) [1;37mSELECT * FROM people WHERE
id = 9 LIMIT 1
[4;35mRelation Load (0.297000) [0;37mSELECT * FROM relations
WHERE from_id = 10 and to_id = 1 LIMIT 1
[4;33mPerson Load (0.203000) [1;37mSELECT * FROM people WHERE
id = 10 LIMIT 1
[4;35mRelation Load (0.203000) [0;37mSELECT * FROM relations
WHERE from_id = 11 and to_id = 1 LIMIT 1
[4;33mPerson Load (0.219000) [1;37mSELECT * FROM people WHERE
id = 11 LIMIT 1
[4;35mRelation Load (0.219000) [0;37mSELECT * FROM relations
WHERE from_id = 8 and to_id = 1 LIMIT 1
[4;33mPerson Load (0.219000) [1;37mSELECT * FROM people WHERE
id = 8 LIMIT 1
[4;35mRelation Load (0.203000) [0;37mSELECT * FROM relations
WHERE from_id = 12 and to_id = 1 LIMIT 1
[4;33mPerson Load (0.234000) [1;37mSELECT * FROM people WHERE
id = 12 LIMIT 1
[4;35mRelation Load (0.281000) [0;37mSELECT * FROM relations
WHERE from_id = 13 and to_id = 1 LIMIT 1
[4;33mPerson Load (0.219000) [1;37mSELECT * FROM people WHERE
id = 13 LIMIT 1
[4;35mRelation Load (0.203000) [0;37mSELECT * FROM relations
WHERE from_id = 14 and to_id = 1 LIMIT 1
[4;33mPerson Load (0.219000) [1;37mSELECT * FROM people WHERE
id = 14 LIMIT 1
[4;35mRelation Load (0.250000) [0;37mSELECT * FROM relations
WHERE from_id = 16 and to_id = 1 LIMIT 1
[4;33mPerson Load (0.203000) [1;37mSELECT * FROM people WHERE
id = 16 LIMIT 1
[4;35mRelation Load (0.281000) [0;37mSELECT * FROM relations
WHERE from_id = 17 and to_id = 1 LIMIT 1
[4;33mPerson Load (0.297000) [1;37mSELECT * FROM people WHERE
id = 17 LIMIT 1
[4;35mRelation Load (0.203000) [0;37mSELECT * FROM relations
WHERE from_id = 18 and to_id = 1 LIMIT 1
[4;33mPerson Load (0.234000) [1;37mSELECT * FROM people WHERE
id = 18 LIMIT 1
[4;35mRelation Load (0.860000) [0;37mSELECT * FROM relations
WHERE from_id = 23 and to_id = 1 LIMIT 1
[4;33mPerson Load (0.250000) [1;37mSELECT * FROM people WHERE
id = 23 LIMIT 1
[4;35mRelation Load (0.218000) [0;37mSELECT * FROM relations
WHERE from_id = 20 and to_id = 1 LIMIT 1
[4;33mPerson Load (1.719000) [1;37mSELECT * FROM people WHERE
id = 20 LIMIT 1
[4;35mRelation Load (0.203000) [0;37mSELECT * FROM relations
WHERE from_id = 24 and to_id = 1 LIMIT 1
[4;33mPerson Load (0.219000) [1;37mSELECT * FROM people WHERE
id = 24 LIMIT 1
[4;35mRelation Load (0.734000) [0;37mSELECT * FROM relations
WHERE from_id = 26 and to_id = 1 LIMIT 1
[4;33mPerson Load (0.125000) [1;37mSELECT * FROM people WHERE
id = 26 LIMIT 1
[4;35mRelation Load (0.110000) [0;37mSELECT * FROM relations
WHERE from_id = 27 and to_id = 1 LIMIT 1
[4;33mPerson Load (0.140000) [1;37mSELECT * FROM people WHERE
id = 27 LIMIT 1
[4;35mPerson Load (0.141000) [0;37mSELECT people.* FROM
people JOIN relations ON relations.to_id = people.id WHERE
relations.from_id = 1 AND relations.family != ''unrelated''
[4;33mPerson Load (0.125000) [1;37mSELECT people.* FROM
people JOIN relations ON relations.to_id = people.id WHERE
relations.from_id = 1 AND relations.family != ''unrelated''
[4;35mPerson Load (0.141000) [0;37mSELECT people.* FROM
people JOIN relations ON relations.to_id = people.id WHERE
relations.from_id = 1 AND relations.family != ''unrelated''
[4;33mPerson Load (0.125000) [1;37mSELECT people.* FROM
people JOIN relations ON relations.to_id = people.id WHERE
relations.from_id = 1 AND relations.family != ''unrelated''
Rendering layouts/xhtml11common (200 OK)
[4;35mFortune Count (0.140000) [0;37mSELECT COUNT(*) FROM fortunes
[4;33mFortune Load (0.500000) [1;37mSELECT * FROM fortunes
WHERE id = 7 LIMIT 1
[4;35mFortune Columns (0.219000) [0;37mSHOW FIELDS FROM fortunes
Completed in 48.422000 (0 reqs/sec) | Rendering: 47.453000 (97%) | DB:
38.500000 (79%)
Queries are getting repeated all over the place, and I''m not sure
exactly what''s causing all the repetition. Most of these queries
aren''t even pulling data that I''m even using. What gives?
--
Bob Aman