Could anyone tell me why this query takes so long?
mysql> select school.school_id as id, school.school_name as name from school left join member_school on school.school_id=member_school.school_id where member_school.member_id=477;
RESULTS:
+------+------------------------------+
| id | name |
+------+------------------------------+
| 5048 | Auburn Bay City Western HS |
| 5562 | Auburn Bay City Western JRHS |
+------+------------------------------+
2 rows in set (<B>9 min 2.28 sec</B>)
the member_school table has:
2481 rows in set (0.88 sec)
the school table has:
1970 rows in set (1.05 sec)
I mean, 9 minutes! you gotta be kidding! what's wrong with my SQL?
mysql> select school.school_id as id, school.school_name as name from school left join member_school on school.school_id=member_school.school_id where member_school.member_id=477;
RESULTS:
+------+------------------------------+
| id | name |
+------+------------------------------+
| 5048 | Auburn Bay City Western HS |
| 5562 | Auburn Bay City Western JRHS |
+------+------------------------------+
2 rows in set (<B>9 min 2.28 sec</B>)
the member_school table has:
2481 rows in set (0.88 sec)
the school table has:
1970 rows in set (1.05 sec)
I mean, 9 minutes! you gotta be kidding! what's wrong with my SQL?