Re: simplifying foreign key/RI checks

2022-05-02 Thread Amit Langote
On Mon, Apr 11, 2022 at 4:47 PM Amit Langote wrote: > This one has been marked Returned with Feedback in the CF app, which > makes sense given the discussion on -committers [1]. > > Agree with the feedback given that it would be better to address *all* > RI trigger check/action functions in the

Re: simplifying foreign key/RI checks

2022-04-11 Thread Amit Langote
On Thu, Apr 7, 2022 at 10:05 AM Amit Langote wrote: > There were rebase conflicts with the recently committed > execPartition.c/h changes. While fixing them, I thought maybe > find_leaf_part_for_key() doesn't quite match in style with its > neighbors in execPartition.h, so changed it to >

Re: simplifying foreign key/RI checks

2022-04-06 Thread Amit Langote
There were rebase conflicts with the recently committed execPartition.c/h changes. While fixing them, I thought maybe find_leaf_part_for_key() doesn't quite match in style with its neighbors in execPartition.h, so changed it to ExecGetLeafPartitionForKey(). -- Amit Langote EDB:

Re: simplifying foreign key/RI checks

2022-03-21 Thread Amit Langote
On Mon, Mar 14, 2022 at 6:28 PM Zhihong Yu wrote: > On Mon, Mar 14, 2022 at 1:33 AM Amit Langote wrote: >> On Tue, Jan 18, 2022 at 3:30 PM Amit Langote wrote: >> > v13 is attached. >> >> I noticed that the recent 641f3dffcdf's changes to >> get_constraint_index() made it basically unusable for

Re: simplifying foreign key/RI checks

2022-03-14 Thread Zhihong Yu
On Mon, Mar 14, 2022 at 1:33 AM Amit Langote wrote: > On Tue, Jan 18, 2022 at 3:30 PM Amit Langote > wrote: > > v13 is attached. > > I noticed that the recent 641f3dffcdf's changes to > get_constraint_index() made it basically unusable for this patch's > purposes. > > Reading in the thread that

Re: simplifying foreign key/RI checks

2022-03-14 Thread Amit Langote
On Tue, Jan 18, 2022 at 3:30 PM Amit Langote wrote: > v13 is attached. I noticed that the recent 641f3dffcdf's changes to get_constraint_index() made it basically unusable for this patch's purposes. Reading in the thread that led to 641f3dffcdf why get_constraint_index() was changed the way it

Re: simplifying foreign key/RI checks

2022-01-17 Thread Amit Langote
Thanks for the review. On Tue, Dec 21, 2021 at 5:54 PM Zhihong Yu wrote: > Hi, > > + int lockflags = 0; > + TM_Result test; > + > + lockflags = TUPLE_LOCK_FLAG_LOCK_UPDATE_IN_PROGRESS; > > The above assignment can be meged with the line where variable lockflags is > declared.

Re: simplifying foreign key/RI checks

2021-12-21 Thread Zhihong Yu
On Mon, Dec 20, 2021 at 5:17 AM Amit Langote wrote: > On Mon, Dec 20, 2021 at 6:19 PM Zhihong Yu wrote: > > On Sun, Dec 19, 2021 at 10:20 PM Amit Langote > wrote: > >> > >> On Mon, Dec 20, 2021 at 2:00 PM Corey Huinker > wrote: > >> > Sorry for the delay. This patch no longer applies, it has

Re: simplifying foreign key/RI checks

2021-12-20 Thread Corey Huinker
> > > > Good catch, thanks. Patch updated. > > > Applies clean. Passes check-world.

Re: simplifying foreign key/RI checks

2021-12-20 Thread Amit Langote
On Mon, Dec 20, 2021 at 6:19 PM Zhihong Yu wrote: > On Sun, Dec 19, 2021 at 10:20 PM Amit Langote wrote: >> >> On Mon, Dec 20, 2021 at 2:00 PM Corey Huinker >> wrote: >> > Sorry for the delay. This patch no longer applies, it has some conflict >> > with

Re: simplifying foreign key/RI checks

2021-12-20 Thread Zhihong Yu
On Sun, Dec 19, 2021 at 10:20 PM Amit Langote wrote: > On Mon, Dec 20, 2021 at 2:00 PM Corey Huinker > wrote: > > Sorry for the delay. This patch no longer applies, it has some conflict > with d6f96ed94e73052f99a2e545ed17a8b2fdc1fb8a > > Thanks Corey for the heads up. Rebased with some

Re: simplifying foreign key/RI checks

2021-12-19 Thread Amit Langote
On Mon, Dec 20, 2021 at 2:00 PM Corey Huinker wrote: > Sorry for the delay. This patch no longer applies, it has some conflict with > d6f96ed94e73052f99a2e545ed17a8b2fdc1fb8a Thanks Corey for the heads up. Rebased with some cosmetic adjustments. -- Amit Langote EDB:

Re: simplifying foreign key/RI checks

2021-12-19 Thread Corey Huinker
> > > > I wasn't able to make much inroads into how we might be able to get > rid of the DETACH-related partition descriptor hacks, the item (3), > though I made some progress on items (1) and (2). > > For (1), the attached 0001 patch adds a new isolation suite > fk-snapshot.spec to exercise

Re: simplifying foreign key/RI checks

2021-11-19 Thread Amit Langote
On Sat, Nov 13, 2021 at 5:43 AM Tom Lane wrote: > Amit Langote writes: > > On Fri, Nov 12, 2021 at 8:19 AM Tom Lane wrote: > >> Anyway, I think that (1) we should write some more test cases around > >> this behavior, (2) you need to establish the snapshot to use in two > >> different ways for

Re: simplifying foreign key/RI checks

2021-11-12 Thread Tom Lane
Amit Langote writes: > On Fri, Nov 12, 2021 at 8:19 AM Tom Lane wrote: >> Anyway, I think that (1) we should write some more test cases around >> this behavior, (2) you need to establish the snapshot to use in two >> different ways for the RI_FKey_check and ri_Check_Pk_Match cases, >> and (3)

Re: simplifying foreign key/RI checks

2021-11-12 Thread Tom Lane
Amit Langote writes: > Whatever mechanism we will use would still need to involve setting a > global Snapshot variable though, right? In v14 we'll certainly still be passing the snapshot(s) to SPI, which will eventually make the snapshot active. With your patch, since we're just handing the

Re: simplifying foreign key/RI checks

2021-11-12 Thread Amit Langote
On Fri, Nov 12, 2021 at 10:58 AM Tom Lane wrote: > I wrote: > > Anyway, I think that (1) we should write some more test cases around > > this behavior, (2) you need to establish the snapshot to use in two > > different ways for the RI_FKey_check and ri_Check_Pk_Match cases, > > and (3)

Re: simplifying foreign key/RI checks

2021-11-11 Thread Amit Langote
On Fri, Nov 12, 2021 at 8:19 AM Tom Lane wrote: > Amit Langote writes: > > Rebased patches attached. > > I've spent some more time digging into the snapshot-management angle. Thanks for looking at this. > I think you are right that the crosscheck_snapshot isn't really an > issue because the

Re: simplifying foreign key/RI checks

2021-11-11 Thread Tom Lane
I wrote: > Anyway, I think that (1) we should write some more test cases around > this behavior, (2) you need to establish the snapshot to use in two > different ways for the RI_FKey_check and ri_Check_Pk_Match cases, > and (3) something's going to have to be done to repair the behavior > in v14

Re: simplifying foreign key/RI checks

2021-11-11 Thread Tom Lane
Alvaro Herrera writes: > I think we (I) should definitely pursue fixing whatever was broken by > DETACH CONCURRENTLY, back to pg14, independently of this patch ... but > I would appreciate some insight into what the problem is. Here's what I'm on about: regression=# create table pk (f1 int

Re: simplifying foreign key/RI checks

2021-11-11 Thread Alvaro Herrera
On 2021-Nov-11, Tom Lane wrote: > It appears to me that commit 71f4c8c6f (DETACH PARTITION CONCURRENTLY) > broke the semantics here, because now things work differently with a > partitioned PK table than with a plain table, thanks to not bothering > to distinguish questions of how to handle

Re: simplifying foreign key/RI checks

2021-11-11 Thread Tom Lane
Amit Langote writes: > Rebased patches attached. I've spent some more time digging into the snapshot-management angle. I think you are right that the crosscheck_snapshot isn't really an issue because the executor pays no attention to it for SELECT, but that doesn't mean that there's no problem,

Re: simplifying foreign key/RI checks

2021-08-29 Thread Corey Huinker
> > Rebased patches attached. I'm reviewing the changes since v6, which was my last review. Making ExecLockTableTuple() it's own function makes sense. Snapshots are now accounted for. The changes that account for n-level partitioning makes sense as well. Passes make check-world. Not user

Re: simplifying foreign key/RI checks

2021-07-05 Thread Amit Langote
On Tue, Jul 6, 2021 at 1:56 AM vignesh C wrote: > The 2nd patch does not apply on Head, please post a rebased version: > error: patch failed: src/backend/utils/adt/ri_triggers.c:337 > error: src/backend/utils/adt/ri_triggers.c: patch does not apply Thanks for the heads up. Rebased patches

Re: simplifying foreign key/RI checks

2021-07-05 Thread vignesh C
On Sun, Apr 4, 2021 at 1:51 PM Amit Langote wrote: > > On Fri, Apr 2, 2021 at 11:55 PM Zhihong Yu wrote: > > > > Hi, > > > > + skip = !ExecLockTableTuple(erm->relation, , markSlot, > > + estate->es_snapshot, > > estate->es_output_cid, > > +

Re: simplifying foreign key/RI checks

2021-04-04 Thread Amit Langote
On Fri, Apr 2, 2021 at 11:55 PM Zhihong Yu wrote: > > Hi, > > + skip = !ExecLockTableTuple(erm->relation, , markSlot, > + estate->es_snapshot, estate->es_output_cid, > + lockmode, erm->waitPolicy, _needed); > + if

Re: simplifying foreign key/RI checks

2021-04-04 Thread Amit Langote
Hi Alvaro, On Sat, Apr 3, 2021 at 12:01 AM Alvaro Herrera wrote: > On 2021-Apr-02, Amit Langote wrote: > > > On Sat, Mar 20, 2021 at 10:21 PM Amit Langote > > wrote: > > > Updated patches attached. Sorry about the delay. > > > > Rebased over the recent DETACH PARTITION CONCURRENTLY work. > >

Re: simplifying foreign key/RI checks

2021-04-02 Thread Alvaro Herrera
On 2021-Apr-02, Amit Langote wrote: > On Sat, Mar 20, 2021 at 10:21 PM Amit Langote wrote: > > Updated patches attached. Sorry about the delay. > > Rebased over the recent DETACH PARTITION CONCURRENTLY work. > Apparently, ri_ReferencedKeyExists() was using the wrong snapshot. Hmm, I wonder if

Re: simplifying foreign key/RI checks

2021-04-02 Thread Zhihong Yu
Hi, + skip = !ExecLockTableTuple(erm->relation, , markSlot, + estate->es_snapshot, estate->es_output_cid, + lockmode, erm->waitPolicy, _needed); + if (skip) It seems the variable skip is only used above. The variable

Re: simplifying foreign key/RI checks

2021-04-02 Thread Amit Langote
On Sat, Mar 20, 2021 at 10:21 PM Amit Langote wrote: > Updated patches attached. Sorry about the delay. Rebased over the recent DETACH PARTITION CONCURRENTLY work. Apparently, ri_ReferencedKeyExists() was using the wrong snapshot. -- Amit Langote EDB: http://www.enterprisedb.com

Re: simplifying foreign key/RI checks

2021-03-20 Thread Amit Langote
On Mon, Mar 8, 2021 at 11:41 PM Amit Langote wrote: > On Thu, Mar 4, 2021 at 5:15 AM Tom Lane wrote: > > I guess I'm disturbed by the idea > > that we'd totally replace the implementation technology for only one > > variant of foreign key checks. That means that there'll be a lot > > of minor

Re: simplifying foreign key/RI checks

2021-03-16 Thread Amit Langote
On Mon, Mar 8, 2021 at 11:41 PM Amit Langote wrote: > On Thu, Mar 4, 2021 at 5:15 AM Tom Lane wrote: > > Lastly, ri_PerformCheck is pretty careful about not only which > > snapshot it uses, but which *pair* of snapshots it uses, because > > sometimes it needs to worry about data changes since

Re: simplifying foreign key/RI checks

2021-03-08 Thread Amit Langote
On Thu, Mar 4, 2021 at 5:15 AM Tom Lane wrote: > I took a quick look at this. Thanks a lot for the review. > I guess I'm disturbed by the idea > that we'd totally replace the implementation technology for only one > variant of foreign key checks. That means that there'll be a lot > of minor

Re: simplifying foreign key/RI checks

2021-03-03 Thread Tom Lane
I took a quick look at this. I guess I'm disturbed by the idea that we'd totally replace the implementation technology for only one variant of foreign key checks. That means that there'll be a lot of minor details that don't act the same depending on context. One point I was just reminded of by

RE: simplifying foreign key/RI checks

2021-03-01 Thread houzj.f...@fujitsu.com
Hi amit, (sorry about not cc the hacker list) I have an issue about command id here. It's probably not directly related to your patch, so I am sorry if it bothers you. + /* +* Start the scan. To make the changes of the current command visible to +* the scan and for

Re: simplifying foreign key/RI checks

2021-03-01 Thread Amit Langote
On Mon, Mar 1, 2021 at 3:14 PM Corey Huinker wrote: >> > It seems to me 1 (RI_PLAN_CHECK_LOOKUPPK) is still alive. (Yeah, I >> > know that doesn't mean the usefulness of the macro but the mechanism >> > the macro suggests, but it is confusing.) On the other hand, >> >

Re: simplifying foreign key/RI checks

2021-02-28 Thread Corey Huinker
> > > It seems to me 1 (RI_PLAN_CHECK_LOOKUPPK) is still alive. (Yeah, I > > know that doesn't mean the usefulness of the macro but the mechanism > > the macro suggests, but it is confusing.) On the other hand, > > RI_PLAN_CHECK_LOOKUPPK_FROM_PK and RI_PLAN_LAST_ON_PK seem to be no > > longer

Re: simplifying foreign key/RI checks

2021-01-27 Thread Amit Langote
On Wed, Jan 27, 2021 at 5:32 PM Kyotaro Horiguchi wrote: > At Sun, 24 Jan 2021 20:51:39 +0900, Amit Langote > wrote in > > Here's v5. > > At Mon, 25 Jan 2021 18:19:56 +0900, Amit Langote > wrote in > > > Anybody else want to look this patch over before I mark it Ready For > > > Committer? >

Re: simplifying foreign key/RI checks

2021-01-27 Thread Kyotaro Horiguchi
At Sun, 24 Jan 2021 20:51:39 +0900, Amit Langote wrote in > Here's v5. At Mon, 25 Jan 2021 18:19:56 +0900, Amit Langote wrote in > > Anybody else want to look this patch over before I mark it Ready For > > Committer? > > Would be nice to have others look it over. Thanks. This nice

Re: simplifying foreign key/RI checks

2021-01-26 Thread Keisuke Kuroda
Hi Amit-san, Thanks for the answer! > If you only tested insert/update on the referencing table, I would've > expected to see nothing in the result of that query, because the patch > eliminates all use of SPI in that case. I suspect the CachedPlan* > memory contexts you are seeing belong to

Re: simplifying foreign key/RI checks

2021-01-26 Thread Tatsuro Yamada
Hi Amit-san, + case TM_Invisible: + elog(ERROR, "attempted to lock invisible tuple"); + break; + + case TM_SelfModified: + case TM_BeingModified: + case TM_WouldBlock: + elog(ERROR, "unexpected table_tuple_lock

Re: simplifying foreign key/RI checks

2021-01-26 Thread Amit Langote
Yamada-san, On Wed, Jan 27, 2021 at 8:51 AM Tatsuro Yamada wrote: > On 2021/01/25 18:19, Amit Langote wrote: > > On Mon, Jan 25, 2021 at 9:24 AM Corey Huinker > > wrote: > >> Anybody else want to look this patch over before I mark it Ready For > >> Committer? > > > > Would be nice to have

Re: simplifying foreign key/RI checks

2021-01-26 Thread Tatsuro Yamada
Hi Amit-san, On 2021/01/25 18:19, Amit Langote wrote: On Mon, Jan 25, 2021 at 9:24 AM Corey Huinker wrote: On Sun, Jan 24, 2021 at 6:51 AM Amit Langote wrote: Here's v5. v5 patches apply to master. Suggested If/then optimization is implemented. Suggested case merging is implemented.

Re: simplifying foreign key/RI checks

2021-01-25 Thread Amit Langote
On Mon, Jan 25, 2021 at 7:01 PM Amit Langote wrote: > On Mon, Jan 25, 2021 at 6:06 PM Keisuke Kuroda > wrote: > > However, as already mentioned, the problem of memory bloat on DELETE > > remains. > > This can be solved by the patch in [1], but I think it is too much to apply > > this patch only

Re: simplifying foreign key/RI checks

2021-01-25 Thread Amit Langote
Kuroda-san, On Mon, Jan 25, 2021 at 6:06 PM Keisuke Kuroda wrote: > Hi, Amit-san, > > Nice patch. I have confirmed that this solves the problem in [1] with > INSERT/UPDATE. Thanks for testing. > HEAD + patch >name | bytes | pg_size_pretty >

Re: simplifying foreign key/RI checks

2021-01-25 Thread Amit Langote
On Mon, Jan 25, 2021 at 9:24 AM Corey Huinker wrote: > On Sun, Jan 24, 2021 at 6:51 AM Amit Langote wrote: >> Here's v5. > > v5 patches apply to master. > Suggested If/then optimization is implemented. > Suggested case merging is implemented. > Passes make check and make check-world yet again. >

Re: simplifying foreign key/RI checks

2021-01-25 Thread Keisuke Kuroda
Hi, Amit-san, Nice patch. I have confirmed that this solves the problem in [1] with INSERT/UPDATE. HEAD + patch name | bytes | pg_size_pretty --+---+ CachedPlanQuery | 10280 | 10 kB CachedPlanSource | 14616 | 14 kB CachedPlan | 13168 |

Re: simplifying foreign key/RI checks

2021-01-24 Thread Corey Huinker
On Sun, Jan 24, 2021 at 6:51 AM Amit Langote wrote: > On Sun, Jan 24, 2021 at 11:26 AM Corey Huinker > wrote: > > On Sat, Jan 23, 2021 at 12:52 PM Zhihong Yu wrote: > >> > >> Hi, > > Thanks for the review. > > >> + for (i = 0; i < riinfo->nkeys; i++) > >> + { > >> + Oid

Re: simplifying foreign key/RI checks

2021-01-24 Thread Amit Langote
On Sun, Jan 24, 2021 at 11:26 AM Corey Huinker wrote: > On Sat, Jan 23, 2021 at 12:52 PM Zhihong Yu wrote: >> >> Hi, Thanks for the review. >> + for (i = 0; i < riinfo->nkeys; i++) >> + { >> + Oid eq_opr = eq_oprs[i]; >> + Oid typeid = RIAttType(fk_rel,

Re: simplifying foreign key/RI checks

2021-01-23 Thread Corey Huinker
On Sat, Jan 23, 2021 at 12:52 PM Zhihong Yu wrote: > Hi, > > + for (i = 0; i < riinfo->nkeys; i++) > + { > + Oid eq_opr = eq_oprs[i]; > + Oid typeid = RIAttType(fk_rel, riinfo->fk_attnums[i]); > + RI_CompareHashEntry *entry =

Re: simplifying foreign key/RI checks

2021-01-23 Thread Zhihong Yu
Hi, + for (i = 0; i < riinfo->nkeys; i++) + { + Oid eq_opr = eq_oprs[i]; + Oid typeid = RIAttType(fk_rel, riinfo->fk_attnums[i]); + RI_CompareHashEntry *entry = ri_HashCompareOp(eq_opr, typeid); + + if (pk_nulls[i] != 'n' &&

Re: simplifying foreign key/RI checks

2021-01-22 Thread Amit Langote
On Fri, Jan 22, 2021 at 3:22 PM Corey Huinker wrote: >> I decided not to deviate from pk_ terminology so that the new code >> doesn't look too different from the other code in the file. Although, >> I guess we can at least call the main function >> ri_ReferencedKeyExists() instead of

Re: simplifying foreign key/RI checks

2021-01-21 Thread Corey Huinker
> > > > I decided not to deviate from pk_ terminology so that the new code > doesn't look too different from the other code in the file. Although, > I guess we can at least call the main function > ri_ReferencedKeyExists() instead of ri_PrimaryKeyExists(), so I've > changed that. > I think

Re: simplifying foreign key/RI checks

2021-01-19 Thread Corey Huinker
> > I decided not to deviate from pk_ terminology so that the new code > doesn't look too different from the other code in the file. Although, > I guess we can at least call the main function > ri_ReferencedKeyExists() instead of ri_PrimaryKeyExists(), so I've > changed that. > I agree with

Re: simplifying foreign key/RI checks

2021-01-18 Thread Amit Langote
On Tue, Jan 19, 2021 at 12:00 PM Zhihong Yu wrote: > + if (mapped_partkey_attnums[i] == pk_attnums[j]) > + { > + partkey_vals[i] = pk_vals[j]; > + partkey_isnull[i] = pk_nulls[j] == 'n' ? true : false; > + i++; > +

Re: simplifying foreign key/RI checks

2021-01-18 Thread Amit Langote
On Tue, Jan 19, 2021 at 3:46 PM Corey Huinker wrote: > v2 patch applies and passes make check and make check-world. Perhaps, given > the missing break at line 418 without any tests failing, we could add another > regression test if we're into 100% code path coverage. As it is, I think the >

Re: simplifying foreign key/RI checks

2021-01-18 Thread Corey Huinker
On Mon, Jan 18, 2021 at 9:45 PM Amit Langote wrote: > On Tue, Jan 19, 2021 at 2:47 AM Zhihong Yu wrote: > > > > Hi, > > I was looking at this statement: > > > > insert into f select generate_series(1, 200, 2); > > > > Since certain generated values (the second half) are not in table p, >

Re: simplifying foreign key/RI checks

2021-01-18 Thread Amit Langote
On Tue, Jan 19, 2021 at 2:56 PM Corey Huinker wrote: >> In file included from >> /home/japin/Codes/postgresql/Debug/../src/include/postgres.h:47:0, >> from >> /home/japin/Codes/postgresql/Debug/../src/backend/utils/adt/ri_triggers.c:24: >>

Re: simplifying foreign key/RI checks

2021-01-18 Thread Corey Huinker
> > > In file included from > /home/japin/Codes/postgresql/Debug/../src/include/postgres.h:47:0, > from > /home/japin/Codes/postgresql/Debug/../src/backend/utils/adt/ri_triggers.c:24: > /home/japin/Codes/postgresql/Debug/../src/backend/utils/adt/ri_triggers.c: > In function

Re: simplifying foreign key/RI checks

2021-01-18 Thread Pavel Stehule
út 19. 1. 2021 v 3:08 odesílatel Amit Langote napsal: > On Tue, Jan 19, 2021 at 3:01 AM Pavel Stehule > wrote: > > po 18. 1. 2021 v 13:40 odesílatel Amit Langote > napsal: > >> I started with the check that's performed when inserting into or > >> updating the referencing table to confirm that

Re: simplifying foreign key/RI checks

2021-01-18 Thread japin
On Tue, 19 Jan 2021 at 10:45, Amit Langote wrote: > On Tue, Jan 19, 2021 at 2:47 AM Zhihong Yu wrote: >> >> Hi, >> I was looking at this statement: >> >> insert into f select generate_series(1, 200, 2); >> >> Since certain generated values (the second half) are not in table p, >> wouldn't

Re: simplifying foreign key/RI checks

2021-01-18 Thread Zhihong Yu
Thanks for the quick response. + if (mapped_partkey_attnums[i] == pk_attnums[j]) + { + partkey_vals[i] = pk_vals[j]; + partkey_isnull[i] = pk_nulls[j] == 'n' ? true : false; + i++; + break; The

Re: simplifying foreign key/RI checks

2021-01-18 Thread Amit Langote
On Tue, Jan 19, 2021 at 2:47 AM Zhihong Yu wrote: > > Hi, > I was looking at this statement: > > insert into f select generate_series(1, 200, 2); > > Since certain generated values (the second half) are not in table p, wouldn't > insertion for those values fail ? > I tried a scaled down

Re: simplifying foreign key/RI checks

2021-01-18 Thread Amit Langote
On Tue, Jan 19, 2021 at 3:01 AM Pavel Stehule wrote: > po 18. 1. 2021 v 13:40 odesílatel Amit Langote > napsal: >> I started with the check that's performed when inserting into or >> updating the referencing table to confirm that the new row points to a >> valid row in the referenced relation.

Re: simplifying foreign key/RI checks

2021-01-18 Thread Pavel Stehule
po 18. 1. 2021 v 13:40 odesílatel Amit Langote napsal: > While discussing the topic of foreign key performance off-list with > Robert and Corey (also came up briefly on the list recently [1], [2]), > a few ideas were thrown around to simplify our current system of RI > checks to enforce foreign

Re: simplifying foreign key/RI checks

2021-01-18 Thread Zhihong Yu
Hi, I was looking at this statement: insert into f select generate_series(1, 200, 2); Since certain generated values (the second half) are not in table p, wouldn't insertion for those values fail ? I tried a scaled down version (1000th) of your example: yugabyte=# insert into f select

simplifying foreign key/RI checks

2021-01-18 Thread Amit Langote
While discussing the topic of foreign key performance off-list with Robert and Corey (also came up briefly on the list recently [1], [2]), a few ideas were thrown around to simplify our current system of RI checks to enforce foreign keys with the aim of reducing some of its overheads. The two