Re: Indexes on partitioned tables and foreign partitions - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Indexes on partitioned tables and foreign partitions
Date
Msg-id CA+TgmoYYEdFeAh8FOwCfB+kgji18WmOoVAEwvYBJtMSQFQ+_Ng@mail.gmail.com
Whole thread Raw
In response to Re: Indexes on partitioned tables and foreign partitions  (Simon Riggs <simon@2ndquadrant.com>)
Responses Re: Indexes on partitioned tables and foreign partitions  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Indexes on partitioned tables and foreign partitions  (Simon Riggs <simon@2ndquadrant.com>)
Re: Indexes on partitioned tables and foreign partitions  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
List pgsql-hackers
On Wed, May 9, 2018 at 9:08 AM, Simon Riggs <simon@2ndquadrant.com> wrote:
> How much sense is it to have a partitioned table with a mix of local
> and foreign tables?

Fair question, but we put some effort into making it work, so I think
it should keep working.

> Shouldn't the fix be to allow creation of indexes on foreign tables?
> (Maybe they would be virtual or foreign indexes??)

It might be useful to invent the concept of a foreign index, but not
for v11 a month after feature freeze.

For right now, I think the options are (1) throw an ERROR if we
encounter a foreign table or (2) silently skip the foreign table.  I
think (2) is defensible for non-UNIQUE indexes, because the index is
just a performance optimization.  However, for UNIQUE indexes, at
least, it seems like we'd better do (1), because a major point of such
an index is to enforce a constraint; we can't allege that we have such
a constraint if foreign tables are just silently skipped.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Global snapshots
Next
From: Robert Haas
Date:
Subject: Re: [HACKERS] Cutting initdb's runtime (Perl question embedded)