Welcome Guest, Not a member yet? Register   Sign In
Site Is So Slow!
#31

[eluser]dmorin[/eluser]
Cool, that helps a lot. So a good exercise when starting with explain is to multiply all of the numbers in the "rows" column together. This is the max number of rows that mysql has to look through the get the result. Because you have a where it won't be quite this high but it's still a good starting point. In your case, it's 803,387,392,390. This starts to explain why your site is a little on the slower side.

So to start, if you're comfortable changing the sql schema, make sure that you have indexes on each of these fields:

Quote:meet_events.id
meet_events.meet_id
meet_events.event_id
events.id
meet_athletes.meet_event_id
meet_athletes.athlete_id
athletes.id
roster.athlete_id
roster.coach_id
coaches.id

I'll be the first to admit that I'm not the best at identifying which fields need indexes, and someone might come along and say having one on one of these fields won't help, but because these are all involved in your join or where statements, it's a pretty safe bet that all of these should have indexes.

Primary key fields should obviously have the Primary key type. If it should be unique use that kind, otherwise just use a plain index. If you have a development server to do it on first, that's good. After you've made the changes, rerun the explain query and post back here.

Hope this is helping. Let us know if you've had enough feedback and want us/me to stop or if you're ok to keep going :-)

Edit: for more info, check out http://hackmysql.com/case4 - Decent article on joins


Messages In This Thread
Site Is So Slow! - by El Forum - 01-09-2009, 08:20 AM
Site Is So Slow! - by El Forum - 01-09-2009, 10:47 AM
Site Is So Slow! - by El Forum - 01-09-2009, 02:10 PM
Site Is So Slow! - by El Forum - 01-09-2009, 03:23 PM
Site Is So Slow! - by El Forum - 01-12-2009, 09:02 AM
Site Is So Slow! - by El Forum - 01-12-2009, 09:30 AM
Site Is So Slow! - by El Forum - 01-12-2009, 10:23 AM
Site Is So Slow! - by El Forum - 01-12-2009, 10:27 AM
Site Is So Slow! - by El Forum - 01-12-2009, 11:46 AM
Site Is So Slow! - by El Forum - 01-12-2009, 11:58 AM
Site Is So Slow! - by El Forum - 01-12-2009, 12:04 PM
Site Is So Slow! - by El Forum - 01-12-2009, 12:10 PM
Site Is So Slow! - by El Forum - 01-12-2009, 12:36 PM
Site Is So Slow! - by El Forum - 01-12-2009, 12:55 PM
Site Is So Slow! - by El Forum - 01-12-2009, 01:02 PM
Site Is So Slow! - by El Forum - 01-12-2009, 01:03 PM
Site Is So Slow! - by El Forum - 01-12-2009, 01:03 PM
Site Is So Slow! - by El Forum - 01-12-2009, 01:06 PM
Site Is So Slow! - by El Forum - 01-12-2009, 01:09 PM
Site Is So Slow! - by El Forum - 01-12-2009, 01:16 PM
Site Is So Slow! - by El Forum - 01-12-2009, 01:17 PM
Site Is So Slow! - by El Forum - 01-12-2009, 01:23 PM
Site Is So Slow! - by El Forum - 01-12-2009, 01:35 PM
Site Is So Slow! - by El Forum - 01-12-2009, 02:07 PM
Site Is So Slow! - by El Forum - 01-12-2009, 03:52 PM
Site Is So Slow! - by El Forum - 01-12-2009, 04:28 PM
Site Is So Slow! - by El Forum - 01-12-2009, 05:00 PM
Site Is So Slow! - by El Forum - 01-12-2009, 05:28 PM
Site Is So Slow! - by El Forum - 01-12-2009, 05:45 PM
Site Is So Slow! - by El Forum - 01-12-2009, 06:20 PM
Site Is So Slow! - by El Forum - 01-12-2009, 06:47 PM
Site Is So Slow! - by El Forum - 01-12-2009, 07:21 PM
Site Is So Slow! - by El Forum - 01-12-2009, 09:38 PM
Site Is So Slow! - by El Forum - 01-13-2009, 03:22 AM
Site Is So Slow! - by El Forum - 01-13-2009, 04:13 AM
Site Is So Slow! - by El Forum - 01-13-2009, 06:14 AM
Site Is So Slow! - by El Forum - 01-13-2009, 07:20 AM



Theme © iAndrew 2016 - Forum software by © MyBB