Re: Single-file databases -- how do they do it?

From: Sim Zacks <sim(at)compulab(dot)co(dot)il>
To: jenjhiz(at)yahoo(dot)com (Gene Kahn)
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Single-file databases -- how do they do it?
Date: 2004-10-11 12:13:01
Message-ID: 1696335627.20041011141301@compulab.co.il
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I'm not an expert on the backend, but here's my best guess. The
database is stored internally as a binary file, not a text file.
Binary files are accessed randomly, not sequentially, so the database
engine opens the file and skips the the portion of the file holding
that table. It then has to hash through the data using the b-tree hash
searching.

So in the end you have a file with a number of entry points, kind of
like a table of contents. The table of contents tells the engine where
in the file to look for the data.

Sim Zacks
IT Manager
CompuLab
04-829-0145 - Office
04-832-5251 - Fax

________________________________________________________________________________

Hello,
How do single-file databases do it? If a database has, say, 10 tables,
does that mean that the single-file is just a trick to hold ten
separate 'boxes' inside, one for each table, or someone has found a
way to store all the tables of a database in one big single table? Can
someone un-curious-ify me?
Thanks,
gk

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Reini Urban 2004-10-11 13:58:09 Re: OT moving from MS SQL to PostgreSQL
Previous Message Peter Eisentraut 2004-10-11 10:23:20 Re: update sequence conversion script