Paging in sybase
Posted on 2003-03-03
Can anyOne help me in this one,
My problem is:
I have to fetch records from the sybase in a page wise manner,like for first page i have to display 10 records and in the second page 10-20 records etc..
but my main preoblem is in that table 3 Bilion records are there ,but at worst condition my select query fetches 1 Milion records.to execute this query it is taking a lot of time.
Currently in my SP i had implimented Rowcount(Rowcount=10 if it is in a first page,20 if second page) etc..
but when the user keep on moves to next Page.. the execution time keeps on increasing.
is there any way to fetch the records from query specifying the startpoint and endpoint.like
select records from 10 to 20
select records from 30 to 40
select records from 40 to 50 etc..
to fetch only 10 records always Query will take less time to execute.
Please Help me out from this problem.
Thanks in advance.