diff --git a/jOOQ/src/main/java/org/jooq/Query.java b/jOOQ/src/main/java/org/jooq/Query.java index 6be35fa292..9cc4e54464 100644 --- a/jOOQ/src/main/java/org/jooq/Query.java +++ b/jOOQ/src/main/java/org/jooq/Query.java @@ -136,6 +136,23 @@ public interface Query extends Statement, AttachableQueryPart { * {@link #keepStatement(boolean)}, the underlying * PreparedStatement will be closed automatically in order for * new bind values to have an effect. + *

Performance consideration

+ *

+ * Historically, the bind value is + * inserted into the mutable {@link Query}, which means that the + * {@link Query} needs to be traversed in order to find the bind value and + * change it. + *

+ * As such, it is usually better to supply bind values directly with the + * input of an expression, e.g.: + *

* * @param param The named parameter name. If this is a number, then this is * the same as calling {@link #bind(int, Object)} @@ -164,6 +181,12 @@ public interface Query extends Statement, AttachableQueryPart { *

* Some bind values may even be repeated by a dialect specific emulation, * leading to duplication and index-shifting. + *

Performance consideration

+ *

+ * Historically, the bind value is + * inserted into the mutable {@link Query}, which means that the + * {@link Query} needs to be traversed in order to find the bind value and + * change it. *

* As such, it is usually better to supply bind values directly with the * input of an expression, e.g.: