HHH-16826: Refactor to avoid costly modulo operation for splitting in clauses

Co-authored-by: Christian Beikov <christian.beikov@gmail.com>
This commit is contained in:
Adrodoc 2023-07-25 18:42:24 +02:00 committed by Christian Beikov
parent 68601df471
commit 148806fe2c
1 changed files with 4 additions and 2 deletions

View File

@ -6897,8 +6897,10 @@ public abstract class AbstractSqlAstTranslator<T extends JdbcOperation> implemen
final Iterator<Expression> iterator = listExpressions.iterator();
Expression listExpression = null;
for ( int i = 0; i < bindValueCountWithPadding; i++ ) {
if ( inExprLimit > 0 && i % inExprLimit == 0 && i != 0 ) {
int clauseItemNumber = 0;
for ( int i = 0; i < bindValueCountWithPadding; i++, clauseItemNumber++ ) {
if ( inExprLimit > 0 && inExprLimit == clauseItemNumber ) {
clauseItemNumber = 0;
appendInClauseSeparator( inListPredicate );
separator = NO_SEPARATOR;
}