Re: Getting count() to include 0 counts in select - slow

2004-11-11 Thread SGreen
This will really speed things up: ALTER TABLE _ISO ADD KEY(_objective_id) If you do an EXPLAIN on your current query, you would see that no index is used for the _iso table so the engine has to do a table scan. And, for future reference, the output of SHOW CREATE TABLES is more informative tha

Getting count() to include 0 counts in select - slow

2004-11-11 Thread Mark Worsdall
SELECT _objectives.id, _objectives.name, COUNT(go._iso._objective_id) FROM go._objectives INNER JOIN go._subjectHeadings         ON go._subjectHeadings.id = go._objectives.subjectHeadings_id INNER JOIN go._subjects         ON go._subjects.id = go._objectives.subjects_id LEFT JOIN go._iso