07. Summary of paging writing

Source: Internet
Author: User
There are several paging implementation methods: 1. in the foreground program, all records are read locally, and the foreground program moves up and down in the dataset through the cursor. If the data volume is large, the performance is poor and is not recommended. when a front-end program requests a certain page of data, it goes to the database for a query and returns the corresponding records that meet the conditions. This is also a common method; 3. peer

There are several paging implementation methods: 1. in the foreground program, all records are read locally, and the foreground program moves up and down in the dataset through the cursor. If the data volume is large, the performance is poor and is not recommended. when a front-end program requests a certain page of data, it goes to the database for a query and returns the corresponding records that meet the conditions. This is also a common method; 3. peer

There are several paging implementation methods:
1. Read all records locally in the front-end program. The front-end program moves up and down the data set through the cursor. If the data volume is large, the Hong Kong Space has poor performance and is not recommended;
2. When a foreground program requests a certain page of data, the VM performs a query in the database and returns the corresponding records that meet the conditions. This is also a common method;
3. for improvement in method 2, when a page is requested and the previous and subsequent pages are returned, the user does not need to request the database repeatedly when turning pages.


For the implementation, the Hong Kong Server is rented. With the upgrade of the SQL Server version, there are three common methods: TOP, ROW_NUMBER, OFFSET/FETCH NEXT.
Test data:

) Split_pages (ID, Name varchar (100) split_pages (10) split_pages

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.