RE: Can we have multiple tablespaces with in a database.

From: Daulat Ram <Daulat(dot)Ram(at)exponential(dot)com>
To: Christophe Pettus <xof(at)thebuild(dot)com>
Cc: amul sul <sulamul(at)gmail(dot)com>, "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: RE: Can we have multiple tablespaces with in a database.
Date: 2020-02-21 06:34:30
Message-ID: MN2PR01MB58544AC29E182D7B35DE2DBC9B120@MN2PR01MB5854.prod.exchangelabs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-performance

You mean we can have only single default tablespace for a database but the database objects can be created on different-2 tablespaces?

Can you please share the Doc URL for your suggestions given in trail mail.

Please correct me.

-----Original Message-----
From: Christophe Pettus <xof(at)thebuild(dot)com>
Sent: Friday, February 21, 2020 11:57 AM
To: Daulat Ram <Daulat(dot)Ram(at)exponential(dot)com>
Cc: amul sul <sulamul(at)gmail(dot)com>; pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Can we have multiple tablespaces with in a database.

> On Feb 20, 2020, at 22:23, Daulat Ram <Daulat(dot)Ram(at)exponential(dot)com> wrote:
>
> That will be great if you share any doc where it’s mentioned that we can’t use multiple tablespace for a single database. I have to assist my Dev team regarding tablespaces.

A single PostgreSQL database can have any number of tablespaces. Each table has to be in one specific tablespace, although a table can be in one tablespace and its indexes in a different one.

If a PostgreSQL table is partitioned, each partition can be in a different tablespace.

Oracle "style" tends to involve a lot of tablespaces in a database; this is much less commonly done in PostgreSQL. In general, you only need to create tablespace in a small number of circumstances:

(a) You need more space than the current database volume allows, and moving the database to a larger volume is inconvenient;
(b) You have multiple volumes with significantly different access characteristics (like an HDD array and some SSDs), and you want to distribute database objects to take advantage of that (for example, put commonly-used large indexes on the SSDs).

PostgreSQL tablespaces do increase the administrative overhead of the database, and shouldn't be created unless there is a compelling need for them./

--
-- Christophe Pettus
xof(at)thebuild(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Daulat Ram 2020-02-21 06:36:39 RE: Can we have multiple tablespaces with in a database.
Previous Message Christophe Pettus 2020-02-21 06:27:06 Re: Can we have multiple tablespaces with in a database.

Browse pgsql-performance by date

  From Date Subject
Next Message Daulat Ram 2020-02-21 06:36:39 RE: Can we have multiple tablespaces with in a database.
Previous Message Christophe Pettus 2020-02-21 06:27:06 Re: Can we have multiple tablespaces with in a database.