I need to searches through records using Full Text Indexing. A search often
returns hundreds of records, and need the user to be able to page through
the result 50 at a time. I *ALSO* need the user to know the first and last
record of each page! (..On the client, i render a list of all pages in the
resultset, and add labels to each page, indicating to the user where in the
resultset the page is positioned).
I have therefor done an SP that inserts my initial search into an in-memory
table. After that i loop through all the records from my initial search, and
insert every 50th record into a different in-memory table. That allows me to
return a resultset with a) the first page of records (first 50 records), and
a table with a complete list of pages.
However, it has come to my attention that my loop through my initial
resultset is taking a lot of performance. So basically, my question is:
i have a large resultset in memory. I need to "sample" records from this,
eg. every 50th record. What would be the fastest way of doing this?