I am in need of a paging concept in my website.i have created a div dynamically for storing data.
suppose i have 200 no of data satisfied my conditions.In one page i want to display only 20 records.In my mind i have two options
1.Select all the 200 records at same time and create 10 div (each div has 20 records).If page 1 is selected then div1 will display and all other remaining divs are hide.If page 3 is selected div3 will display.In this method only one time the database operation is happened.
2.In this method i have selected records between the corresponding ranges.ie;if page 3 is selected then 40 to 60 records will select and it displays.if page 4 then 60 to 80 only.like that.
which is best method?in first method only one time database operation is happened,but it need to select entire records .I think it will create problems for large no of records(above 100000).
But in second method only a limited no of records is selected at every time ,but for each time a database round trip is rewuired.
so which is the correct method in the view of performance?
View Complete Post