Skip to content

Commit 43689d0

Browse files
committed
add document about lazy cursor fetch
Signed-off-by: Yang Keao <[email protected]>
1 parent a71c69b commit 43689d0

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Diff for: system-variables.md

+18
Original file line numberDiff line numberDiff line change
@@ -2772,6 +2772,24 @@ Query OK, 0 rows affected (0.09 sec)
27722772
27732773
- You can use the [`TIDB_ROW_CHECKSUM()`](/functions-and-operators/tidb-functions.md#tidb_row_checksum) function to get the checksum value of a row.
27742774
2775+
### `tidb_enable_lazy_cursor_fetch` <span class="version-mark">New in v8.3.0</span>
2776+
2777+
> **Warning:**
2778+
>
2779+
> The feature controlled by this variable is experimental. It is not recommended that you use it in the production environment.
2780+
2781+
- Scope: GLOBAL
2782+
- Persists to cluster: Yes
2783+
- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): No
2784+
- Type: Boolean
2785+
- Default value: `OFF`
2786+
- This variable controls the behavior of the [Cursor Fetch](/develop/dev-guide-connection-parameters.md#use-streamingresult-to-get-the-execution-result) feature. When the variable is `OFF`, and Cursor Fetch is enabled, TiDB will read all the data at the start of statement execution and store it in TiDB's memory. Subsequently, the data is returned to the client based on the client's specified `FetchSize`. If the result set is too large, it may temporarily write the result to disk. When the variable is `ON`, and Cursor Fetch is enabled, TiDB will not read all the data into the TiDB node at once but will read data into the TiDB node incrementally as the client fetches it.
2787+
- The feature has the following limitations:
2788+
1. It does not support statements within explicit transactions.
2789+
2. It only supports execution plans involving `TableReader`, `IndexReader`, `IndexLookUp`, `Projection`, and `Selection`.
2790+
3. For statements using Lazy Cursor Fetch, execution information will not appear in the [Statements Summary](/statement-summary-tables.md) and [Slow Log](/identify-slow-queries.md).
2791+
- For unsupported scenarios, the behavior will remain consistent with the variable being `OFF`.
2792+
27752793
### tidb_enforce_mpp <span class="version-mark">New in v5.1</span>
27762794
27772795
- Scope: SESSION

0 commit comments

Comments
 (0)