Removing primaryKeys search based on limit and merging it to scan instead