Re: [HACKERS] MERGE SQL Statement for PG11

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>
Cc: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>, Pavan Deolasee <pavan(dot)deolasee(at)2ndquadrant(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] MERGE SQL Statement for PG11
Date: 2018-02-07 17:22:02
Message-ID: CAH2-Wzmk7RQ-v1DjhfK==s0ejPxpCWFtnwR3J4tW_t7ZvjT_Sw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Feb 7, 2018 at 1:24 AM, Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com> wrote:
> Here is v15 of the patch.

Cool.

> Initially I was a bit surprised that EvalPlanQual silently ignores the case
> when partition key is updated and a row is moved from one partition to
> another. But then I realised that this is the behaviour of the partitioned
> tables and not MERGE itself.

Apparently there is a pending patch to do better there - the commit
message of 2f178441 refers to this.

> The revised version also supports subqueries in SET targetlist as well as
> WHEN AND conditions. As expected, this needed a minor tweak in
> query/expression mutators. So once I worked on that for partitioned tables,
> subqueries started working with very minimal adjustments elsewhere. Other
> things such as whole-var references are still broken. A few new tests are
> also added.

Great!

Wholerow references are expected to be a bit trickier. See commit
ad227837 for some hints on how you could fix this.

> Next I am going to look at RLS. While I've no prior experience with RLS, I
> am expecting it to be less cumbersome in comparison to partitioning. I am
> out of action till Monday and may not be able to respond in time. But any
> reviews and comments are appreciated as always.

I don't think that RLS support will be particularly challenging. It
might take a while.

If your rapid progress here is any indication, most open items are not
likely to be particularly challenging. Once again, I suggest that a
good area for us to focus on is the semantics of READ COMMITTED
conflict handling. Maybe you'd prefer to just blast through the
simpler open items, which is fine, but do bear in mind that the EPQ
and EPQ-adjacent stuff is probably going to be the thing that makes or
breaks this patch for v11.

--
Peter Geoghegan

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Markus Nullmeier 2018-02-07 18:02:34 Re: [HACKERS] Proposal: generic WAL compression
Previous Message Robert Haas 2018-02-07 17:09:26 Re: [HACKERS] More stats about skipped vacuums