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

From: Siddharth Jain <siddhsql(at)gmail(dot)com>
To: Christophe Pettus <xof(at)thebuild(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: How does Postgres store a B-Tree on disk while using the OS file system?
Date: 2023-03-07 02:53:16
Message-ID: CAPqV3pQGEcqP6HG8mmo2qa0wj9gm731K+msbngjKBk8ZJy9GGA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

thanks Christophe. will try to go through it. its bit difficult to grasp.

On Mon, Mar 6, 2023 at 5:08 PM Christophe Pettus <xof(at)thebuild(dot)com> wrote:

>
>
> > On Mar 6, 2023, at 16:24, Siddharth Jain <siddhsql(at)gmail(dot)com> wrote:
> > 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.
>
> All of PostgreSQL's relations (tables and indexes) are stored in files.
> (They're actually stored in a set of files if it's larger than 1GB, but
> each relation is treated as one logical file.) The "pointers" in this case
> are just offsets from the start of that file.
>
> There's some additional information here:
>
> https://www.postgresql.org/docs/current/storage.html
>
> and here:
>
> https://www.postgresql.org/docs/current/btree-implementation.html

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2023-03-07 03:11:42 Re: Idea: PostgreSQL equivalent to Oracle's KEEP clause
Previous Message David Rowley 2023-03-07 02:51:14 Re: Idea: PostgreSQL equivalent to Oracle's KEEP clause