How does Postgres store a B-Tree on disk while using the OS file system?

From: Siddharth Jain <siddhsql(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: How does Postgres store a B-Tree on disk while using the OS file system?
Date: 2023-03-07 00:24:56
Message-ID: CAPqV3pSQnzOVRkUujhGNjRZ=oN2HjkMydMH933hE1r=uxtbt9Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I am trying to sharpen my understanding of Postgres. As I understand,
Postgres does not write directly to disk blocks. It uses the file system
provided by the OS:
https://dba.stackexchange.com/questions/80036/is-there-a-way-to-store-a-postgresql-database-directly-on-a-block-device-not-fi
My question: How can it then store a B Tree on disk? I would think storing
a B Tree requires storing disk offset addresses and so on (for a node to
navigate to another etc.). For this, one would need to write directly to
the disk using low-level disk access functions and not use file system API.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ron 2023-03-07 00:49:14 Re: How does Postgres store a B-Tree on disk while using the OS file system?
Previous Message Tom Lane 2023-03-06 23:40:43 Re: Idea: PostgreSQL equivalent to Oracle's KEEP clause