Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> On Mar 6, 2023, at 16:24, Siddharth Jain <siddhsql@xxxxxxxxx> 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





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux