Skip to content

Commit

Permalink
Remove copyable
Browse files Browse the repository at this point in the history
  • Loading branch information
dveeden committed Nov 27, 2023
1 parent 7a50ce6 commit c62b4e0
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions functions-and-operators/tidb-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand All @@ -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
```
Expand All @@ -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
```
Expand All @@ -114,8 +108,6 @@ REPLICATIONSTATUS_STATEID: NULL
1 row in set (0.005 sec)
```

{{< copyable "sql" >}}

```sql
select tidb_decode_key('7480000000000000FF3E5F720400000000FF0000000601633430FF3338646232FF2D64FF3531632D3131FF65FF622D386337352DFFFF3830653635303138FFFF61396265000000FF00FB000000000000F9');
```
Expand Down Expand Up @@ -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"]';
Expand Down Expand Up @@ -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);
```
Expand All @@ -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));
```
Expand Down

0 comments on commit c62b4e0

Please sign in to comment.