Re: [HACKERS] Partitioning vs ON CONFLICT - Mailing list pgsql-hackers

From Amit Langote
Subject Re: [HACKERS] Partitioning vs ON CONFLICT
Date
Msg-id 1213bbc3-e636-c624-c491-af9289126931@lab.ntt.co.jp
Whole thread Raw
In response to Re: [HACKERS] Partitioning vs ON CONFLICT  (Peter Geoghegan <pg@bowt.ie>)
Responses Re: [HACKERS] Partitioning vs ON CONFLICT
List pgsql-hackers
On 2017/02/17 1:17, Peter Geoghegan wrote:
> But surely it should be possible to use DO NOTHING without inferring some
> particular unique index? That's possible with an approach based on
> inheritance.

Hmm.  Code after the following comment fragment in ExecInsert():
            * Do a non-conclusive check for conflicts first.

would be working on a leaf partition chosen by tuple-routing after an
insert on a partitioned table.  The leaf partitions can very well have a
unique index, which can be used for inference.  The problem however is
that infer_arbiter_indexes() in the optimizer would be looking at the root
partitioned, which cannot yet have any indexes defined on them, let alone
unique indexes.  When we develop a feature where defining an index on the
root partitioned table would create the same index on all the leaf
partitions and then extend it to support unique indexes, then we can
perhaps talk about supporting ON CONFLICT handing.  Does that make sense?

Thanks,
Amit





pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] Implement custom join algorithm
Next
From: Peter Geoghegan
Date:
Subject: Re: [HACKERS] Partitioning vs ON CONFLICT