fix cursor overshooting granularity boundaries for filtered queries