Re: Revert RI fast-path batching from REL_19_STABLE
Re: Revert RI fast-path batching from REL_19_STABLE
От:
Melanie Plageman <melanieplageman@gmail.com>
Дата:
On Wed, Sep 9, 2026 at 8:26 AM Amit Langote wrote: > > That still leaves your concern about whether the per-row path is > sufficiently solid for v19. The snapshot fixes and Amit's recent > collation report show that there are differences from SPI that we (I) > missed. The proposed collation fix falls back to SPI when the > referenced index and column collations differ. I still propose > retaining the per-row path, but agree that its readiness needs to be > assessed separately from the decision to remove batching. I think a good start would be to revert the batching ASAP so that we can consider the state after independently. - Melanie
Re: Revert RI fast-path batching from REL_19_STABLE
От:
Robert Haas <robertmhaas@gmail.com>
Дата:
On Wed, Sep 9, 2026 at 11:41 AM Melanie Plageman wrote: > On Wed, Sep 9, 2026 at 8:26 AM Amit Langote wrote: > > That still leaves your concern about whether the per-row path is > > sufficiently solid for v19. The snapshot fixes and Amit's recent > > collation report show that there are differences from SPI that we (I) > > missed. The proposed collation fix falls back to SPI when the > > referenced index and column collations differ. I still propose > > retaining the per-row path, but agree that its readiness needs to be > > assessed separately from the decision to remove batching. > > I think a good start would be to revert the batching ASAP so that we > can consider the state after independently. +1. -- Robert Haas EDB: http://www.enterprisedb.com
Re: Revert RI fast-path batching from REL_19_STABLE
От:
Amit Langote <amitlangote09@gmail.com>
Дата:
On Thu, Sep 10, 2026 at 3:20 PM Amit Langote wrote: > On Thu, Sep 10, 2026 at 12:57 PM Amit Kapila wrote: > > On Wed, Sep 9, 2026 at 9:12 PM Melanie Plageman > > wrote: > > > > > > On Wed, Sep 9, 2026 at 8:26 AM Amit Langote wrote: > > > > > > > > That still leaves your concern about whether the per-row path is > > > > sufficiently solid for v19. The snapshot fixes and Amit's recent > > > > collation report show that there are differences from SPI that we (I) > > > > missed. The proposed collation fix falls back to SPI when the > > > > referenced index and column collations differ. I still propose > > > > retaining the per-row path, but agree that its readiness needs to be > > > > assessed separately from the decision to remove batching. > > > > > > I think a good start would be to revert the batching ASAP so that we > > > can consider the state after independently. > > > > BTW, it is not clear to me from this response whether it should be > > reverted for both 19 and 20 or just 19? I feel the reason to keep in > > 20 could be that it needs some (known) adjustments/bug-fixes and more > > testing but if there are still larger design issues, it will be better > > to revert even from 20. I was planning to evaluate that part but that > > needs more time, so it is better to first revert batching from 19, fix > > some reported issues for per-row optimization and evaluate whether it > > has any serious issues and make a decision based on that. Then > > independently, we can evaluate the batching state for 20 and take a > > call. > > I have now reverted batching in REL_19_STABLE after pushing the > snapshot fix for the per-row path to master and REL_19_STABLE. and . > Batching remains in master for now. > > With that, I've marked the following open items as fixed: > > #1 RI fast-path batching fails during nested SET CONSTRAINTS > #2 RI fast-path batching wrongly used by ALTER TABLE inside a trigger > #3 Stale snapshot in RI fast-path leads to spurious failure > > The fixes for #1 and #2 still need to be applied to master. Those > patches are posted at [1]. > > Later today, I will push the attached patches addressing Amit's review > in this thread to both branches. 0001 clarifies the tuple-lock result > handling comments. 0002 fixes the collation mismatch by falling back > to SPI. There are separate versions of 0002 for REL_19_STABLE, with > batching removed, and master, where both the per-row and batched paths > need the fallback. I've pushed 0001. I'm holding off on 0002 until tomorrow to give Amit some time to comment if he wants to. -- Thanks, Amit Langote
Re: Revert RI fast-path batching from REL_19_STABLE
Hi, On Fri, Sep 11, 2026 at 5:52 PM Amit Langote wrote: > On Thu, Sep 10, 2026 at 5:58 PM Amit Langote wrote: > > On Thu, Sep 10, 2026 at 3:20 PM Amit Langote wrote: > > > I have now reverted batching in REL_19_STABLE after pushing the > > > snapshot fix for the per-row path to master and REL_19_STABLE. and . > > > Batching remains in master for now. When 25649d6e79 removed batching from REL_19_STABLE, I was not careful enough to remove some setup steps in the test added by 1390182683 (the snapshot fix, committed before the revert) to ensure that the per-row path, whose bug it fixed, was indeed taken. Attached patch removes that obsolete and unnecessary part of the test case. I checked that the test case still verifies that the PushActiveSnapshot() added as a fix is necessary. Note that this is for REL_19_STABLE only, because master still has batching, though I'm starting to have second thoughts about that. More on that later. -- Thanks, Amit Langote
Re: Revert RI fast-path batching from REL_19_STABLE
Hi, On Thu, Sep 10, 2026 at 3:20 PM Amit Langote wrote: > I have now reverted batching in REL_19_STABLE after pushing the > snapshot fix for the per-row path to master and REL_19_STABLE. and . > Batching remains in master for now. I propose removing batching from master as well. The patch to do so is attached. I had hoped we could continue fixing the remaining issues on master, but delaying checks to accumulate a batch has implications that I haven't fully accounted for. For example, as mentioned upthread, Tomas reported to me off-list that other AFTER ROW triggers can modify the referenced table before a buffered check runs, changing its result compared with checking immediately. We could address that particular case by disabling batching when such triggers exist. I have also posted patches for other reported issues, but I'd prefer to step back and revert all the batching-related code for now. My ability to work on these fixes is also limited in the near term due to some personal circumstances. I'd still like to revisit batching in a separate proposal, or at least bring back some of the useful pieces removed by this revert, such as caching of opened relations and TupleTableSlots. Any objections to removing it from master for now? -- Thanks, Amit Langote
Re: Revert RI fast-path batching from REL_19_STABLE
От:
Amit Langote <amitlangote09@gmail.com>
Дата:
On Thu, Oct 1, 2026 at 9:05 PM Amit Langote wrote: > > Hi, > > On Thu, Sep 10, 2026 at 3:20 PM Amit Langote wrote: > > I have now reverted batching in REL_19_STABLE after pushing the > > snapshot fix for the per-row path to master and REL_19_STABLE. and . > > Batching remains in master for now. > > I propose removing batching from master as well. The patch to do so is attached. > > I had hoped we could continue fixing the remaining issues on master, > but delaying checks to accumulate a batch has implications that I > haven't fully accounted for. For example, as mentioned upthread, Tomas > reported to me off-list that other AFTER ROW triggers can modify the > referenced table before a buffered check runs, changing its result > compared with checking immediately. > > We could address that particular case by disabling batching when such > triggers exist. I have also posted patches for other reported issues, > but I'd prefer to step back and revert all the batching-related code > for now. My ability to work on these fixes is also limited in the near > term due to some personal circumstances. > > I'd still like to revisit batching in a separate proposal, or at least > bring back some of the useful pieces removed by this revert, such as > caching of opened relations and TupleTableSlots. > > Any objections to removing it from master for now? Done. -- Thanks, Amit Langote