- All Known Implementing Classes:
DefaultTransformProvider
For convenience, consider extending DefaultTransformProvider
instead
of implementing this interface. This will prevent compilation errors in
future versions of jOOQ, when this interface might get new methods.
- Author:
- Lukas Eder
-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
inlineBindValuesForFieldComparisons
(Field<?> field) [#5970] Inline all bind variables that are compared with the argument field.
-
Method Details
-
inlineBindValuesForFieldComparisons
[#5970] Inline all bind variables that are compared with the argument field.In some cases, using a bind variable isn't the right choice when comparing a value with a
Field
. This could be the case e.g. when:- The field stems from a constant discriminator column in a view, e.g.
in a
UNION
- The field statistics suggest there are only few possible values, with unequal distribution
- The field is an
ENUM
or has aCHECK
constraint (special case of the above)
In all of those cases, it may be more optimal to query
FIELD = 'x'
rather thanFIELD = ?
to help the optimiser use more accurate statistics for the specific inline value, rather than an average distribution assumption for a generic bind value.Affected
QueryPart
typesThe following
Condition
types are affected by this transformation:Settings
The feature can be activated using
Settings.isTransformInlineBindValuesForFieldComparisons()
.- Parameters:
field
- The field for which bind values could be inlined.- Returns:
- Whether bind value should be inlined.
- The field stems from a constant discriminator column in a view, e.g.
in a
-