You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: functions-and-operators/tidb-functions.md
-14Lines changed: 0 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -53,8 +53,6 @@ This section provides examples for some of the functions above.
53
53
54
54
In the following example, the table `t1` has a hidden `rowid` that is generated by TiDB. The `TIDB_DECODE_KEY` is used in the statement. From the result, you can see that the hidden `rowid` is decoded and output, which is a typical result for the non-clustered primary key.
In the following example, the table `t2` has a compound clustered primary key. From the JSON output, you can see a `handle` that contains the name and value for both of the columns that are part of the primary key.
@@ -232,8 +224,6 @@ This function returns a string, which is in the format of a JSON string array. T
232
224
> * This function has a high overhead. In queries with a large number of rows (for example, querying the full table of `information_schema.cluster_tidb_trx` on a large and busy cluster), using this function might cause the queries to run for too long. Use it with caution.
233
225
> * This function has a high overhead because every time it is called, it internally queries the `STATEMENTS_SUMMARY`, `STATEMENTS_SUMMARY_HISTORY`, `CLUSTER_STATEMENTS_SUMMARY`, and `CLUSTER_STATEMENTS_SUMMARY_HISTORY` tables, and the query involves the `UNION` operation. This function currently does not support vectorization, that is, when calling this function for multiple rows of data, the above query is performed separately for each row.
234
226
235
-
{{< copyable "sql" >}}
236
-
237
227
```sql
238
228
set @digests = '["e6f07d43b5c21db0fbb9a31feac2dc599787763393dd5acbfad80e247eb02ad5","38b03afa5debbdf0326a014dbe5012a62c51957f1982b3093e748460f8b00821","e5796985ccafe2f71126ed6c0ac939ffa015a8c0744a24b7aee6d587103fd2f7"]';
239
229
@@ -303,8 +293,6 @@ The following example shows how to use the `TIDB_SHARD` function.
303
293
304
294
The following statement shows how to use the `TIDB_SHARD` function to calculate the SHARD value of `12373743746`:
305
295
306
-
{{< copyable "sql">}}
307
-
308
296
```sql
309
297
SELECT TIDB_SHARD(12373743746);
310
298
```
@@ -322,8 +310,6 @@ The following example shows how to use the `TIDB_SHARD` function.
322
310
323
311
- Create a shard index using the `TIDB_SHARD` function:
324
312
325
-
{{< copyable "sql">}}
326
-
327
313
```sql
328
314
CREATE TABLE test(id INT PRIMARY KEY CLUSTERED, a INT, b INT, UNIQUE KEY uk((tidb_shard(a)), a));
0 commit comments