check scan_index_forward and limit are passed correctly for query_count