datetime index skipped for same query different params
From the looks of the two EXPLAIN plans, you may need another index.
From the WHERE clause of
SELECT count(*) as total_students FROM students s,subjects b
WHERE s.subjectid = b.subjectid AND s.attended&gt;'2012-05-22 00:00:00'
AND s.classid=47;

I suggest creating the following compound index
ALTER TABLE subjects ADD INDEX subjectid_attended_ndx (subjectid,attended);

Give it a Try !!!
CAVEAT
As suggested in the comment from @AaronBertrand, the cardinality of the index may be causing random results depending on different values for subjectid (47 vs 43 vs some other value).