Improved query and added indexes used to identify grid records