Physical paging and logical paging, physical paging logical Paging

Source: Internet
Author: User

Physical paging and logical paging, physical paging logical Paging
1 Overview 1. Physical Paging

Physical paging depends on a physical entity, which is a database. For example, MySQL database provides the limit keyword. Programmers only need to write SQL statements with the limit keyword, the database returns paging results.

2. Logical Paging

Logical paging depends on the Code Compiled by the programmer. The database returns not paging results, but all data, and then the programmer obtains paging data through code. A common operation is to query all data from the database at one time and store it in the List set, because the List set is ordered, data in the specified range is obtained based on the index.

Ii. Comparison 1. Database burden

The physical pages access the database each time, and the logical pages only access the database once. The physical pages impose a high burden on the database.

2. server load

Logical paging reads data to the memory at a time, occupying a large amount of content space. Physical paging reads only a portion of data at a time, consuming less memory space.

3. Real-time

The data is read to the memory in one operation by logical paging, and the data changes. The latest database status cannot be reflected in the operation in real time, resulting in poor real-time performance. Each time data is required for physical paging, the database is accessed to obtain the latest database status, which is highly real-time.

4. Applicable scenarios

Logical paging is mainly used when the data volume is small and the data is stable. Physical paging is mainly used when the data volume is large and frequently updated.

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.