JC: added index on task_id. Spec passes.