Optimized past timecard entries query