In List Predicate Optimization
caution
This article only explains how to enable the relevant options.
As for what these options are used for, please refer to Query Chapter/DSL Expression/IN LIST/Optimization, this article will not repeat it.
Enable Padding Optimization
Two ways to enable:
-
If you are using the Jimmer Spring Boot Starter, modify
application.yml
(orapplication.properties
) as follows:application.ymljimmer:
in-list-padding-enabled: true -
If you are not using the Jimmer Spring Boot Starter, you need to call the following API when creating the
sqlClient
:- Java
- Kotlin
JSqlClient sqlClient = JSqlClient
.newBuilder()
.setInListPaddingEnabled(true)
// ...omitted other configurations...
.build();val sqlClient = newKSqlClient {
setInListPaddingEnabled(true)
// ...omitted other configurations...
}
Enable Any Equality Optimization
Two ways to enable:
-
If you are using the Jimmer Spring Boot Starter, modify
application.yml
(orapplication.properties
) as follows:application.ymljimmer:
in-list-to-any-equality-enabled: true -
If you are not using the Jimmer Spring Boot Starter, you need to call the following API when creating the
sqlClient
:- Java
- Kotlin
JSqlClient sqlClient = JSqlClient
.newBuilder()
.setInListToAnyEqualityEnabled(true)
// ...omitted other configurations...
.build();val sqlClient = newKSqlClient {
setInListToAnyEqualityEnabled(true)
// ...omitted other configurations...
}