limit rows optimization