Re: Eliminating SPI from RI triggers - take 2

2023-07-10 Thread Amit Langote
On Mon, Jul 10, 2023 at 5:27 PM Daniel Gustafsson wrote: > > On 21 Mar 2023, at 06:03, Amit Langote wrote: > > On Tue, Mar 21, 2023 at 3:54 AM Gregory Stark (as CFM) > > wrote: > >> On Mon, 17 Oct 2022 at 14:59, Robert Haas wrote: > > >>> But I think the bigger problem for this patch set is

Re: Eliminating SPI from RI triggers - take 2

2023-07-10 Thread Daniel Gustafsson
> On 21 Mar 2023, at 06:03, Amit Langote wrote: > On Tue, Mar 21, 2023 at 3:54 AM Gregory Stark (as CFM) > wrote: >> On Mon, 17 Oct 2022 at 14:59, Robert Haas wrote: >>> But I think the bigger problem for this patch set is that the >>> design-level feedback from >>>

Re: Eliminating SPI from RI triggers - take 2

2023-03-20 Thread Amit Langote
Hi Greg, On Tue, Mar 21, 2023 at 3:54 AM Gregory Stark (as CFM) wrote: > On Mon, 17 Oct 2022 at 14:59, Robert Haas wrote: > > But I think the bigger problem for this patch set is that the > > design-level feedback from > >

Re: Eliminating SPI from RI triggers - take 2

2023-03-20 Thread Gregory Stark (as CFM)
On Mon, 17 Oct 2022 at 14:59, Robert Haas wrote: > > On Sat, Oct 15, 2022 at 1:47 AM Amit Langote wrote: > > But I think the bigger problem for this patch set is that the > design-level feedback from >

Re: Eliminating SPI from RI triggers - take 2

2022-12-06 Thread Andres Freund
Hi, On 2022-10-15 14:47:05 +0900, Amit Langote wrote: > Attached updated patches. These started to fail to build recently: [04:43:33.046] ccache cc -Isrc/backend/postgres_lib.a.p -Isrc/include -I../src/include -Isrc/include/storage -Isrc/include/utils -Isrc/include/catalog -Isrc/include/nodes

Re: Eliminating SPI from RI triggers - take 2

2022-10-17 Thread Robert Haas
On Sat, Oct 15, 2022 at 1:47 AM Amit Langote wrote: > I have merged your incremental patch into 0003. Note that if someone goes to commit 0003, they would have no idea that I contributed to the effort. You should probably try to keep a running list of co-authors, reviewers, or other people that

Re: Eliminating SPI from RI triggers - take 2

2022-10-14 Thread Amit Langote
On Wed, Oct 12, 2022 at 2:27 AM Robert Haas wrote: > > On Thu, Sep 29, 2022 at 12:47 AM Amit Langote wrote: > > [ patches ] > > While looking over this thread I came across this code: Thanks for looking. > /* For data reading, executor always omits detached partitions */ > if

Re: Eliminating SPI from RI triggers - take 2

2022-10-11 Thread Robert Haas
On Thu, Sep 29, 2022 at 12:47 AM Amit Langote wrote: > [ patches ] While looking over this thread I came across this code: /* For data reading, executor always omits detached partitions */ if (estate->es_partition_directory == NULL) estate->es_partition_directory =

Re: Eliminating SPI from RI triggers - take 2

2022-10-11 Thread Amit Langote
On Fri, Oct 7, 2022 at 7:17 PM Amit Langote wrote: > On Fri, Oct 7, 2022 at 19:15 Alvaro Herrera wrote: >> On 2022-Oct-07, Amit Langote wrote: >> > > Thanks for the heads up. Hmm, this I am not sure how to reproduce on >> > > my own, so I am currently left with second-guessing what may be going

Re: Eliminating SPI from RI triggers - take 2

2022-10-07 Thread Amit Langote
On Fri, Oct 7, 2022 at 19:15 Alvaro Herrera wrote: > On 2022-Oct-07, Amit Langote wrote: > > > > Thanks for the heads up. Hmm, this I am not sure how to reproduce on > > > my own, so I am currently left with second-guessing what may be going > > > wrong on 32 bit machines with whichever of the

Re: Eliminating SPI from RI triggers - take 2

2022-10-07 Thread Alvaro Herrera
On 2022-Oct-07, Amit Langote wrote: > > Thanks for the heads up. Hmm, this I am not sure how to reproduce on > > my own, so I am currently left with second-guessing what may be going > > wrong on 32 bit machines with whichever of the 4 patches. > > > > For now, I'll just post 0001, which I am

Re: Eliminating SPI from RI triggers - take 2

2022-10-07 Thread Amit Langote
On Fri, Oct 7, 2022 at 6:26 PM Amit Langote wrote: > On Sun, Oct 2, 2022 at 10:24 AM Andres Freund wrote: > > On 2022-10-01 18:21:15 -0700, Andres Freund wrote: > > > On 2022-09-29 18:18:10 +0900, Amit Langote wrote: > > > > So, here's a final revision for today. Sorry for the noise. > > > > >

Re: Eliminating SPI from RI triggers - take 2

2022-10-07 Thread Amit Langote
On Sun, Oct 2, 2022 at 10:24 AM Andres Freund wrote: > On 2022-10-01 18:21:15 -0700, Andres Freund wrote: > > On 2022-09-29 18:18:10 +0900, Amit Langote wrote: > > > So, here's a final revision for today. Sorry for the noise. > > > > This appears to fail on 32bit systems. Seems the new test is

Re: Eliminating SPI from RI triggers - take 2

2022-10-01 Thread Andres Freund
Hi, On 2022-10-01 18:21:15 -0700, Andres Freund wrote: > On 2022-09-29 18:18:10 +0900, Amit Langote wrote: > > So, here's a final revision for today. Sorry for the noise. > > This appears to fail on 32bit systems. Seems the new test is indeed > worthwhile... > >

Re: Eliminating SPI from RI triggers - take 2

2022-10-01 Thread Andres Freund
Hi, On 2022-09-29 18:18:10 +0900, Amit Langote wrote: > So, here's a final revision for today. Sorry for the noise. This appears to fail on 32bit systems. Seems the new test is indeed worthwhile... https://cirrus-ci.com/task/6581521615159296?logs=test_world_32#L406 [19:12:24.452] Summary of

Re: Eliminating SPI from RI triggers - take 2

2022-09-29 Thread Amit Langote
On Thu, Sep 29, 2022 at 6:09 PM Amit Langote wrote: > On Thu, Sep 29, 2022 at 4:43 PM Amit Langote wrote: > > On Thu, Sep 29, 2022 at 1:46 PM Amit Langote > > wrote: > > > Sorry about the delay. > > > > > > So I came up with such a patch that is attached as 0003. > > > > > > The main problem I

Re: Eliminating SPI from RI triggers - take 2

2022-09-29 Thread Amit Langote
On Thu, Sep 29, 2022 at 4:43 PM Amit Langote wrote: > On Thu, Sep 29, 2022 at 1:46 PM Amit Langote wrote: > > Sorry about the delay. > > > > So I came up with such a patch that is attached as 0003. > > > > The main problem I want to fix with it is the need for RI_FKey_check() > > to "force"-push

Re: Eliminating SPI from RI triggers - take 2

2022-09-29 Thread Amit Langote
On Thu, Sep 29, 2022 at 1:46 PM Amit Langote wrote: > Sorry about the delay. > > So I came up with such a patch that is attached as 0003. > > The main problem I want to fix with it is the need for RI_FKey_check() > to "force"-push the latest snapshot that the PartitionDesc code wants > to use to

Re: Eliminating SPI from RI triggers - take 2

2022-09-28 Thread Amit Langote
On Thu, Aug 4, 2022 at 1:05 PM Amit Langote wrote: > On Wed, Jul 13, 2022 at 8:59 PM Amit Langote wrote: > > That bit came in to make DETACH CONCURRENTLY produce sane answers for > > RI queries in some cases. > > > > I guess my comment should really have said something like: > > > > HACK:

Re: Eliminating SPI from RI triggers - take 2

2022-08-03 Thread Amit Langote
On Wed, Jul 13, 2022 at 8:59 PM Amit Langote wrote: > On Sat, Jul 9, 2022 at 1:15 AM Robert Haas wrote: > Thanks for taking a look at this. I'll try to respond to other points > in a separate email, but I wanted to clarify something about below: > > > I find my ego slightly wounded by the

Re: Eliminating SPI from RI triggers - take 2

2022-07-13 Thread Amit Langote
On Sat, Jul 9, 2022 at 1:15 AM Robert Haas wrote: > On Fri, Jul 1, 2022 at 2:23 AM Amit Langote wrote: > > So, I hacked together a patch (attached 0001) that invents an "RI > > plan" construct (struct RIPlan) to replace the use of an "SPI plan" > > (struct _SPI_plan). > > > > With that in place,

Re: Eliminating SPI from RI triggers - take 2

2022-07-11 Thread Robert Haas
On Fri, Jul 8, 2022 at 10:07 PM Tom Lane wrote: > Uh ... if such caching behavior is at all competently implemented, > it will be transparent because the cache will notice and respond to > events that should change its outputs. Well, that assumes that we emit appropriate invalidations in every

Re: Eliminating SPI from RI triggers - take 2

2022-07-08 Thread Tom Lane
Robert Haas writes: > ... I think there's some > debate to be had here over what behavior we need to preserve exactly > vs. what we can and should change. For sure. For example, people occasionally complain because user-defined triggers can defeat RI integrity checks. Should we change that?

Re: Eliminating SPI from RI triggers - take 2

2022-07-08 Thread Robert Haas
On Fri, Jul 1, 2022 at 2:23 AM Amit Langote wrote: > So, I hacked together a patch (attached 0001) that invents an "RI > plan" construct (struct RIPlan) to replace the use of an "SPI plan" > (struct _SPI_plan). > > With that in place, I decided to rebase my previous patch [1] to use > this new

Re: Eliminating SPI from RI triggers - take 2

2022-07-06 Thread Amit Langote
On Wed, Jul 6, 2022 at 11:55 AM Amit Langote wrote: > On Wed, Jul 6, 2022 at 3:24 AM Jacob Champion wrote: > > On Thu, Jun 30, 2022 at 11:23 PM Amit Langote > > wrote: > > > > > > I will continue investigating what to do about points (1) and (2) > > > mentioned above and see if we can do away

Re: Eliminating SPI from RI triggers - take 2

2022-07-05 Thread Amit Langote
On Wed, Jul 6, 2022 at 3:24 AM Jacob Champion wrote: > On Thu, Jun 30, 2022 at 11:23 PM Amit Langote wrote: > > > > I will continue investigating what to do about points (1) and (2) > > mentioned above and see if we can do away with using SQL in the > > remaining cases. > > Hi Amit, looks like

Re: Eliminating SPI from RI triggers - take 2

2022-07-05 Thread Jacob Champion
On Thu, Jun 30, 2022 at 11:23 PM Amit Langote wrote: > > I will continue investigating what to do about points (1) and (2) > mentioned above and see if we can do away with using SQL in the > remaining cases. Hi Amit, looks like isolation tests are failing in cfbot:

Eliminating SPI from RI triggers - take 2

2022-07-01 Thread Amit Langote
Hi, I had proposed $subject for some RI trigger functions in the last dev cycle [1]. Briefly, the proposal was to stop using an SQL query (using the SPI interface) for RI checks that could be done by directly scanning the primary/unique key index of the referenced table, which must always be