From: Ron <ronljohnsonjr@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: How does Postgres store a B-Tree on disk while using the OS file system?
Date: Mon, 6 Mar 2023 18:49:14 -0600
Message-ID: <8e25aeed-b834-8e4e-1d11-2ea00b2d13cb@gmail.com> (raw)
In-Reply-To: <CAPqV3pSQnzOVRkUujhGNjRZ=oN2HjkMydMH933hE1r=uxtbt9Q@mail.gmail.com>
References: <CAPqV3pSQnzOVRkUujhGNjRZ=oN2HjkMydMH933hE1r=uxtbt9Q@mail.gmail.com>
On 3/6/23 18:24, Siddharth Jain wrote:
> 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...
> 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.
Disk offsets... *file* offsets... one is just a step up on the abstraction
layer.
How can that be? The OS only knows about Logical Block Addresses, which are
a huge list of block numbers (just like userland software sees files as long
lists of bytes). It hasn't see cylinders, heads and platters in almost
FORTY (more, probably, for SCSI and mainframe systems) years.
--
Born in Arizona, moved to Babylonia.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: ronljohnsonjr@gmail.com
Subject: Re: How does Postgres store a B-Tree on disk while using the OS file system?
In-Reply-To: <8e25aeed-b834-8e4e-1d11-2ea00b2d13cb@gmail.com>
References: <CAPqV3pSQnzOVRkUujhGNjRZ=oN2HjkMydMH933hE1r=uxtbt9Q@mail.gmail.com> <8e25aeed-b834-8e4e-1d11-2ea00b2d13cb@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox