significant performance improvement in agenda query