Hi am trying to run a simple query on a mysql database and it seems to bring my database server to its knees. I can not figure out why. I need help!
Below is my problem query:
SELECT scs.classNumber, l.locationID, c.courseID
FROM sunclassschedule scs, location l, course c
WHERE scs.locationCode = l.locationCode
AND scs.courseCode = c.courseCode
The relationship between scs and l is one to one. The same goes for scs and c. The fields that I am using to join these tables are text fields that are unique but not the primary key on the tables. scs have about 2600 records in it. l has 240 records and c has 460 records. This query should return 2600 records, which it does, but it takes about ten minutes to process at 99% cpu utilization.
When I run this query the mysql process starts out at a very low cpu utilization and slowly grows until it reaches 99%.
Does anyone have any idea what is going on with this query?
Thanks,
Michael Grove
Below is my problem query:
SELECT scs.classNumber, l.locationID, c.courseID
FROM sunclassschedule scs, location l, course c
WHERE scs.locationCode = l.locationCode
AND scs.courseCode = c.courseCode
The relationship between scs and l is one to one. The same goes for scs and c. The fields that I am using to join these tables are text fields that are unique but not the primary key on the tables. scs have about 2600 records in it. l has 240 records and c has 460 records. This query should return 2600 records, which it does, but it takes about ten minutes to process at 99% cpu utilization.
When I run this query the mysql process starts out at a very low cpu utilization and slowly grows until it reaches 99%.
Does anyone have any idea what is going on with this query?
Thanks,
Michael Grove