-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#25488] YSQL: small internal refactor decoupling ri_BatchSize
Summary: Commit a120c25 mostly decouples YB's INSERT ON CONFLICT batching from foreign data wrapper INSERT batching. The one thing still being shared is ri_BatchSize. Decouple that in this commit. While at it, improve performance by skipping evaluating all the conditions every time to check whether INSERT ON CONFLICT batching is possible by caching this into a field. Here is the flow (using a partitioned table since that is the most complicated case): - ExecInitModifyTable: run YbIsInsertOnConflictReadBatchingPossible on the parent table and cache the result to parent resultRelInfo.ri_ybIocBatchingPossible. (This is not necessary in this case since we can't insert directly to the parent table, but it doesn't hurt to do it and this is needed for non-partitioned table cases.) - ExecModifyTable: for each input slot, route to the child table. If this is the first time using that child table, run YbIsInsertOnConflictReadBatchingPossible on it and cache the result to that child resultRelInfo.ri_ybIocBatchingPossible. In case batching is possible for this partition, add the slot to batch, and if this is the first time doing that for this partition, create the batching state on demand. From here on, use ri_ybIocBatchingPossible && yb_ioc_state to determine whether batching is enabled for a partition. Jira: DB-14746 Test Plan: On Almalinux 8: #!/usr/bin/env bash set -euo pipefail ./yb_build.sh fastdebug --gcc11 find java/yb-pgsql/src/test/java/org/yb/pgsql -name 'TestPgRegressInsertOnConflict*' \ | grep -oE 'TestPgRegress\w+' \ | while read -r testname; do ./yb_build.sh fastdebug --gcc11 --java-test "$testname" --sj done Close: #25488 Reviewers: kramanathan Reviewed By: kramanathan Subscribers: yql Differential Revision: https://phorge.dev.yugabyte.com/D40869
- Loading branch information
Showing
5 changed files
with
43 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters