I have a database with `250,000,000 records`, this records are necessary for daily operations(can't give much detail about this) and can't be moved to a historic database, there is a historic database even larger. 

I have a form with several filters for the query, my problem is when the search query has no parameters and has to search the entire database. I don't want to retrieve the whole database at once. I want to do it in small batches of 1,000 every time the user clicks the next page in the results grid.

I'm currently doing somethin like this:

```
SELECT * FROM
(SELECT col1,col2,col3,
ROW_NUMBER() over(ORDER BY col1) as rownum
 FROM table1) x
 WHERE rownum BETWEEN 20000001 AND 20001000;

```

It works fast with a small table but if i want to search in ranges over 10,000 it gets slower and slower.

How can i achieve this?

Thanks.