faster queries for diffing