Added an index on dmg_state(output_id)