- I have a table of Tests and Patients. The test table has a "Patient_ID" that points to the ID (primary key) of coresponding patient in the patient table. All is fine and dandy when I have 100 patients, each with 10 tests (testTable has 1,000 tests). When I have 1,000 patients with 10 tests each (10,000 tests) it works for most queries, but when joining the tables, it locks up. By locking up, I mean it sat there for over 10 minutes without responding.
This is the line that freezes it:
SELECT COUNT(*) FROM patientTable LEFT JOIN testTable ON (testTable.Patient_ID = patientTable.ID) WHERE some condition
This works for the 1,000 tests, but not 10,000 tests. I even upgraded to MySQL 4.0.7 gamma and the same happened. MySQL does not have any public forums, and want quite a bit of money for support. Is this a bug or is my database just to big for SQL to handle?
|