Re: One tablespace or several tablespaces

From: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "'Begin Daniel *EXTERN*'" <jfd553(at)hotmail(dot)com>, Kevin Grittner <kgrittn(at)gmail(dot)com>, JORGE MALDONADO <jorgemal1960(at)gmail(dot)com>
Cc: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: One tablespace or several tablespaces
Date: 2016-04-11 15:32:50
Message-ID: A737B7A37273E048B164557ADEF4A58B5383DB63@ntex2010i.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Begin Daniel wrote:
> On Sat, Apr 2, 2016 at 1:42 PM, JORGE MALDONADO <jorgemal1960(at)gmail(dot)com> wrote:
>> I am developing an information system that will be used by several
>> clientes, each client has its own database, and each database has
>> exactly the same structure for each client. The only difference is the name of the database.
>> I have been thinking about whether or not using one tablespace to
>> create all of the databases or to use one tablespace for each
>> database, but I have not found a good reason for using one method or the other.
>
> Generally I have found it best to use a single tablespace except when there is a clear reason to do
> otherwise. Usually that reason, if it exists, is to allow storing less frequently accessed data on a
> slow, cheaper medium.
> --------
> Another reason to use multiple tablespaces is if IO operations are slowing down significantly because
> the queries have to access several large tables at the same time (i.e. read/write tens of GB by
> table). In this case, it might be a good idea to distribute IO operations by spreading on several
> disks the tables that are often used together.
>
> Otherwise (smaller tables or expensive queries are only sporadic), keep everything together as Kevin
> suggested.

I have been told that the device I/O queue can become a bottleneck on
Linux if there is a lot of I/O going to a single device, and that it is
better to spread this across moltiple devices (via tablespaces or
striping).

I have not been able to personally observe this.

Yours,
Laurenz Albe

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Kevin Struckhoff 2016-04-11 17:28:28 Upgrading from Postgres 9.3 to 9.5
Previous Message Begin Daniel 2016-04-11 14:56:48 Re: One tablespace or several tablespaces