PostgreSQL Physical storage structure

Source: Internet
Author: User
Tags postgresql

Postgresql currently does not support the use of bare devices and block devices.

Postgresql belongs to

Relation: Represents a table or index.

Tuple: Represents a row in a table.

Page: Represents a block of data on disk.

Buffer: Represents a block of data in memory.

Page Structure

Page default size is 8KB, maximum 32KB, one block of data can hold multiple rows of data. The structure in the block is as follows:

The header records the following information:

The checksum value of the block

Start and end positions for free space

Starting position of special data

Some other information

The line pointer is a 32bit number with the following structure:

The offset of the line content, accounting for 15bit;

The marker of the pointer, accounting for 2bit;

The length of the line content, accounting for 15bit.

The offset for the row content in the row pointer is 15bit, and the maximum offset that can be represented is 2^15=32768, so the maximum size of the block is 32768, or 32KB.

PostgreSQL Physical storage structure

Related Article

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.