Skip to content

Commit a894da9

Browse files
committed
add more docs in the fetchSize doc
Signed-off-by: Yang Keao <[email protected]>
1 parent cee7882 commit a894da9

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

best-practices/java-app-best-practices.md

+4
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ Usually, there are two kinds of processing methods in JDBC:
7474

7575
TiDB supports both methods, but it is preferred that you use the first method, because it is a simpler implementation and has a better execution efficiency.
7676

77+
For the second method, TiDB will load all data to the TiDB node at first and then return them to the client according to the fetch size. Therefore, it'll usually use more memory than the first choice and may spill the data to the temporary storage if [`tidb_enable_tmp_storage_on_oom`](/system-variables.md#tidb_enable_tmp_storage_on_oom) is `ON`.
78+
79+
If the system variable [`tidb_enable_lazy_cursor_fetch`](/system-variables.md#tidb_enable_lazy_cursor_fetch) is `ON`, TiDB will try to only fetch the data when the client fetches it, and use less memory. For detail and limitations, read the description of the variable [`tidb_enable_lazy_cursor_fetch`](/system-variables.md#tidb_enable_lazy_cursor_fetch).
80+
7781
### MySQL JDBC parameters
7882

7983
JDBC usually provides implementation-related configurations in the form of JDBC URL parameters. This section introduces [MySQL Connector/J's parameter configurations](https://dev.mysql.com/doc/connector-j/en/connector-j-reference-configuration-properties.html) (If you use MariaDB, see [MariaDB's parameter configurations](https://mariadb.com/kb/en/library/about-mariadb-connector-j/#optional-url-parameters)). Because this document cannot cover all configuration items, it mainly focuses on several parameters that might affect performance.

develop/dev-guide-connection-parameters.md

+4
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,10 @@ Usually, there are two kinds of processing methods in JDBC:
155155
156156
TiDB supports both methods, but it is preferred that you use the first method, because it is a simpler implementation and has a better execution efficiency.
157157
158+
For the second method, TiDB will load all data to the TiDB node at first and then return them to the client according to the fetch size. Therefore, it'll usually use more memory than the first choice and may spill the data to the temporary storage if [`tidb_enable_tmp_storage_on_oom`](/system-variables.md#tidb_enable_tmp_storage_on_oom) is `ON`.
159+
160+
If the system variable [`tidb_enable_lazy_cursor_fetch`](/system-variables.md#tidb_enable_lazy_cursor_fetch) is `ON`, TiDB will try to only fetch the data when the client fetches it, and use less memory. For detail and limitations, read the description of the variable [`tidb_enable_lazy_cursor_fetch`](/system-variables.md#tidb_enable_lazy_cursor_fetch).
161+
158162
### MySQL JDBC parameters
159163
160164
JDBC usually provides implementation-related configurations in the form of JDBC URL parameters. This section introduces [MySQL Connector/J's parameter configurations](https://dev.mysql.com/doc/connector-j/en/connector-j-reference-configuration-properties.html) (If you use MariaDB, see [MariaDB's parameter configurations](https://mariadb.com/kb/en/library/about-mariadb-connector-j/#optional-url-parameters)). Because this document cannot cover all configuration items, it mainly focuses on several parameters that might affect performance.

system-variables.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2138,7 +2138,7 @@ mysql> SELECT job_info FROM mysql.analyze_jobs ORDER BY end_time DESC LIMIT 1;
21382138
- Possible values: `OFF`, `ON`
21392139
- This variable controls whether to support creating `Global indexes` for partitioned tables. `Global index` is currently in the development stage. **It is not recommended to modify the value of this system variable**.
21402140

2141-
### `tidb_enable_lazy_cursor_fetch` <span class="version-mark">New in v8.3.0</span>
2141+
### tidb_enable_lazy_cursor_fetch <span class="version-mark">New in v8.3.0</span>
21422142

21432143
> **Warning:**
21442144
>

0 commit comments

Comments
 (0)