Re: make default TABLESPACE belong to target table.

From: Amos Bird <amosbird(at)gmail(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: make default TABLESPACE belong to target table.
Date: 2016-11-25 13:47:37
Message-ID: 87vavbfz7q.fsf@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


> So you would like locate those index tablespaces into the same
> tablespace as its parent relation when the index is created for a
> unique index or as a primary key?

Yes, and I'd like this behavior take effect when default_tablespace is
set to something like "parent".

> But what would be the difference with default_tablespace?

What do you mean? AFAIK, default_tablespace option cannot tell which
tablespace the parent table is in.

> I think that you are looking for a replacement for something that is
> already doable.

Hmm, I've done my research and asked around IRC channels. There is
little info come to my mind. could you give me some hint?

Michael Paquier writes:

> On Fri, Nov 25, 2016 at 4:48 PM, Amos Bird <amosbird(at)gmail(dot)com> wrote:
>> I've been using postgres for a long time. Recently I'm doing table
>> sharding over a bunch of pgsql instances. I'm using multiple tablespaces
>> one per disk to utilize all the IO bandwidth. Things went on pretty
>> well, however there is a troublesome problem I have when adding
>> auxiliary structures to sharded tables, such as Indexes. These objects
>> have their storage default to the database's tablespace, and it's
>> difficult to shard them by hand.
>>
>> I'd like to implement this small feature --- making table's auxiliary
>> structures store their data to the target table's tablespace by default.
>> I've done a thorough search over the mailing list and there is nothing
>> relevant. Well I may miss some corners :-)
>
> So you would like locate those index tablespaces into the same
> tablespace as its parent relation when the index is created for a
> unique index or as a primary key? Perhaps we could have a
> session-level parameter that enforces the creation of such indexes on
> the same tablespace as the table... But what would be the difference
> with default_tablespace? I think that you are looking for a
> replacement for something that is already doable.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2016-11-25 14:17:04 Re: make default TABLESPACE belong to target table.
Previous Message Amit Kapila 2016-11-25 13:18:18 Re: [sqlsmith] Failed assertion in parallel worker in ExecInitSubPlan