diff --git a/functions-and-operators/tidb-functions.md b/functions-and-operators/tidb-functions.md index 6ac2fbd0da231..f3de2e9230dd2 100644 --- a/functions-and-operators/tidb-functions.md +++ b/functions-and-operators/tidb-functions.md @@ -53,8 +53,6 @@ This section provides examples for some of the functions above. 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. -{{< copyable "sql" >}} - ```sql SELECT START_KEY, TIDB_DECODE_KEY(START_KEY) FROM information_schema.tikv_region_status WHERE table_name='t1' AND REGION_ID=2\G ``` @@ -68,8 +66,6 @@ TIDB_DECODE_KEY(START_KEY): {"_tidb_rowid":1958897,"table_id":"59"} 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. -{{< copyable "sql" >}} - ```sql show create table t2\G ``` @@ -86,8 +82,6 @@ Create Table: CREATE TABLE `t2` ( 1 row in set (0.001 sec) ``` -{{< copyable "sql" >}} - ```sql select * from information_schema.tikv_region_status where table_name='t2' limit 1\G ``` @@ -114,8 +108,6 @@ REPLICATIONSTATUS_STATEID: NULL 1 row in set (0.005 sec) ``` -{{< copyable "sql" >}} - ```sql select tidb_decode_key('7480000000000000FF3E5F720400000000FF0000000601633430FF3338646232FF2D64FF3531632D3131FF65FF622D386337352DFFFF3830653635303138FFFF61396265000000FF00FB000000000000F9'); ``` @@ -232,8 +224,6 @@ This function returns a string, which is in the format of a JSON string array. T > * 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. > * 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. -{{< copyable "sql" >}} - ```sql set @digests = '["e6f07d43b5c21db0fbb9a31feac2dc599787763393dd5acbfad80e247eb02ad5","38b03afa5debbdf0326a014dbe5012a62c51957f1982b3093e748460f8b00821","e5796985ccafe2f71126ed6c0ac939ffa015a8c0744a24b7aee6d587103fd2f7"]'; @@ -303,8 +293,6 @@ The following example shows how to use the `TIDB_SHARD` function. The following statement shows how to use the `TIDB_SHARD` function to calculate the SHARD value of `12373743746`: - {{< copyable "sql" >}} - ```sql SELECT TIDB_SHARD(12373743746); ``` @@ -322,8 +310,6 @@ The following example shows how to use the `TIDB_SHARD` function. - Create a shard index using the `TIDB_SHARD` function: - {{< copyable "sql" >}} - ```sql CREATE TABLE test(id INT PRIMARY KEY CLUSTERED, a INT, b INT, UNIQUE KEY uk((tidb_shard(a)), a)); ```