Re: patch : Allow toast tables to be moved to a different tablespace

From: Andreas Karlsson <andreas(at)proxel(dot)se>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Julien Tachoires <julmon(at)gmail(dot)com>, Alex Shulgin <ash(at)commandprompt(dot)com>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Jaime Casanova <jaime(at)2ndquadrant(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: patch : Allow toast tables to be moved to a different tablespace
Date: 2015-03-12 02:50:41
Message-ID: 5500FF01.3020308@proxel.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 03/10/2015 01:23 PM, Robert Haas wrote:
> On Mon, Mar 9, 2015 at 7:26 PM, Andreas Karlsson <andreas(at)proxel(dot)se> wrote:
>>>> - I do not like how \d handles the toast tablespace. Having TOAST in
>>>> pg_default and the table in another space looks the same as if there was
>>>> no TOAST table at all. I think we should always print both tablespaces
>>>> if either of them are not pg_default.
>>>
>>> If we do it that way, we should always show the tablespace even if it's
>>> pg_default in any case to be consistent. I'm pretty sure that we don't
>>> want that.
>>
>> I think we will have to agree to disagree here. I think it should be obvious
>> when the toast table is in the default tablespace for tables outside it.
>
> I'm not sure about the details here, but that seems like a pretty
> sound principle.

What I am talking about are the 6 cases below of \d with the current
code. I think that case 4) and 5) look the same, which may confuse users
skimming the \d into thinking that we have no TOAST table in the case
where the TOAST table is in pg_default while the table tablespace is
somewhere else.

1. Table in pg_default, no TOAST

Column | Type | Modifiers
--------+---------+-----------
x | integer |

2. Table in pg_default, TOAST in pg_default

Column | Type | Modifiers
--------+------+-----------
x | text |

3. Table in pg_default, TOAST in ts1

Column | Type | Modifiers
--------+------+-----------
x | text |
TOAST Tablespace: "ts1"

4. Table in ts1, no TOAST

Column | Type | Modifiers
--------+---------+-----------
x | integer |
Tablespace: "ts1"

5. Table in ts1, TOAST in pg_default

Column | Type | Modifiers
--------+------+-----------
x | text |
Tablespace: "ts1"

6. Table in ts1, TOAST in ts1

Column | Type | Modifiers
--------+------+-----------
x | text |
Tablespace: "ts1"
TOAST Tablespace: "ts1"

>> I think we should allow moving the indexes for consistency. With this patch
>> we can move everything except for TOAST indexes.
>
> It might make sense to always put the TOAST index with the TOAST
> table, but it seems strange to put the TOAST index with the heap and
> the TOAST table someplace else. Or at least, that's how it seems to
> me.

Ok, my idea was that one might want to put all indexes in a third table
space, including TOAST indexes. Not sure how realistic this use case is.

--
Andreas Karlsson

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2015-03-12 03:51:50 Re: EvalPlanQual behaves oddly for FDW queries involving system columns
Previous Message Tom Lane 2015-03-12 02:16:52 Re: logical column ordering