Re: Qualifying use of separate TABLESPACES (performance/functionality)

From: Christophe Pettus <xof(at)thebuild(dot)com>
To: Imndlf8r(at)gmx(dot)com
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Qualifying use of separate TABLESPACES (performance/functionality)
Date: 2024-07-17 04:57:01
Message-ID: 70BDA5E1-F800-44CB-A1FC-C7597D53ABCD@thebuild.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> On Jul 16, 2024, at 21:45, Imndlf8r(at)gmx(dot)com wrote:
> Or, does Postgres expect to be able to access any media however it wants
> (i.e., R/w), regardless of the expected access patterns of the data stored
> there?

Well, yes and no.

PostgreSQL will not respond well to having media that is literally read only in the sense that a write operation to it will fail. At some point, it will need to (for example) vacuum the tables, and that will means writes. That being said, if the only thing in a tablespace are tables (and their indexes) that are written once then never again, you won't be constantly getting writes to them. You may want to do a VACUUM (ANALYZE, FREEZE) on the tables in those tablespaces once the data is loaded.

PostgreSQL will be generating WAL as you do data-modifying operations, so that should be aimed at storage that very low write fatigue. Be very cautious about using a RAM disk for anything, though, unless you are *very* confident the battery backup on it is 100% reliable. PostgreSQL isn't designed to handle recovery from having the WAL just disappear out from under it on a crash.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Imndlf8r 2024-07-17 09:45:04 Re: Qualifying use of separate TABLESPACES (performance/functionality)
Previous Message Imndlf8r 2024-07-17 04:45:57 Qualifying use of separate TABLESPACES (performance/functionality)