Re: More efficient RI checks - take 2 - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: More efficient RI checks - take 2
Date
Msg-id 20200421153454.GA19350@alvherre.pgsql
Whole thread Raw
In response to Re: More efficient RI checks - take 2  (Corey Huinker <corey.huinker@gmail.com>)
Responses Re: More efficient RI checks - take 2  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: More efficient RI checks - take 2  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
On 2020-Apr-20, Corey Huinker wrote:

> > I can imagine removal of the SPI from the current implementation (and
> > constructing the plans "manually"), but note that the queries I use in my
> > patch are no longer that trivial. So the SPI makes sense to me because it
> > ensures regular query planning.
> 
> As an intermediate step, in the case where we have one row, it should be
> simple enough to extract that row manually, and do an SPI call with fixed
> values rather than the join to the ephemeral table, yes?

I do wonder if the RI stuff would actually end up being faster without
SPI.  If not, we'd only end up writing more code to do the same thing.
Now that tables can be partitioned, it is much more of a pain than when
only regular tables could be supported.  Obviously without SPI you
wouldn't *have* to go through the planner, which might be a win in
itself if the execution tree to use were always perfectly clear ... but
now that the queries get more complex per partitioning and this
optimization, is it?

You could remove the crosscheck_snapshot feature from SPI, I suppose,
but that's not that much code.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Andreas Karlsson
Date:
Subject: Re: [PATCH] distinct aggregates within a window function WIP
Next
From: Andres Freund
Date:
Subject: Re: design for parallel backup