Re: Remove duplicate table scan in logical apply worker and code refactoring

2024-08-01 Thread Amit Kapila
On Thu, Aug 1, 2024 at 7:29 AM Hayato Kuroda (Fujitsu) wrote: > > > Thanks for reviewing the patch, and your understanding is correct. > > > > Here is the updated patch 0001. I removed the comments as suggested by Amit. > > > > Since 0002 patch is only refactoring the code and I need some time to

RE: Remove duplicate table scan in logical apply worker and code refactoring

2024-07-31 Thread Hayato Kuroda (Fujitsu)
Dear Hou, > Thanks for reviewing the patch, and your understanding is correct. > > Here is the updated patch 0001. I removed the comments as suggested by Amit. > > Since 0002 patch is only refactoring the code and I need some time to review > the comments for it, I will hold it until the 0001 is

RE: Remove duplicate table scan in logical apply worker and code refactoring

2024-07-31 Thread Zhijie Hou (Fujitsu)
On Wednesday, July 31, 2024 5:07 PM Kuroda, Hayato/黒田 隼人 wrote: > > Dear Hou, > > > When reviewing the code in logical/worker.c, I noticed that when > > applying a cross-partition update action, it scans the old partition twice. > > I am attaching the patch 0001 to remove this duplicate table s

RE: Remove duplicate table scan in logical apply worker and code refactoring

2024-07-31 Thread Hayato Kuroda (Fujitsu)
Dear Hou, Thanks for creating a patch! > When reviewing the code in logical/worker.c, I noticed that when applying a > cross-partition update action, it scans the old partition twice. > I am attaching the patch 0001 to remove this duplicate table scan. Just to clarify, you meant that FindReplTup

Re: Remove duplicate table scan in logical apply worker and code refactoring

2024-07-29 Thread Amit Kapila
On Thu, Jul 25, 2024 at 5:56 PM Kirill Reshke wrote: > > > +/* > > + * If the tuple to be modified could not be found, a log message is > > emitted. > > + */ > > +static void > > +report_tuple_not_found(CmdType cmd, Relation targetrel, bool is_partition) > > +{ > > + Assert(cmd == CMD_UPDATE || c

Re: Remove duplicate table scan in logical apply worker and code refactoring

2024-07-29 Thread Amit Kapila
On Thu, Jul 25, 2024 at 4:00 PM Zhijie Hou (Fujitsu) wrote: > > When reviewing the code in logical/worker.c, I noticed that when applying a > cross-partition update action, it scans the old partition twice. > I am attaching the patch 0001 to remove this duplicate table scan. > > The test shows tha

Re: Remove duplicate table scan in logical apply worker and code refactoring

2024-07-26 Thread Ashutosh Bapat
On Thu, Jul 25, 2024 at 5:56 PM Kirill Reshke wrote: > > +/* > > + * If the tuple to be modified could not be found, a log message is > > emitted. > > + */ > > +static void > > +report_tuple_not_found(CmdType cmd, Relation targetrel, bool is_partition) > > +{ > > + Assert(cmd == CMD_UPDATE || cm

Re: Remove duplicate table scan in logical apply worker and code refactoring

2024-07-25 Thread Kirill Reshke
Hi! > When reviewing the code in logical/worker.c, I noticed that when applying a > cross-partition update action, it scans the old partition twice. Nice catch! > -/* > - * Workhorse for apply_handle_update() > - * relinfo is for the relation we're actually updating in > - * (could be a child p