Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Oreoxmt committed Jul 20, 2022
1 parent 1824574 commit ce57785
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 21 deletions.
15 changes: 3 additions & 12 deletions develop/dev-guide-bookshop-schema-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,9 @@ To make your reading on the application developer guide more smoothly, we presen

## Import table structures and data

You can import Bookshop table structures and data either [via TiUP](#via-tiup-demo) or [via the import feature of TiDB Cloud](#via-tidb-cloud-import).
You can import Bookshop table structures and data either [via TiUP](#method-1-via-tiup-demo) or [via the import feature of TiDB Cloud](#method-2-via-tidb-cloud-import).

<SimpleTab>
<div label="Via `TiUP demo`">

### Via `tiup demo`
### Method 1: Via `tiup demo`

If your TiDB cluster is deployed using [TiUP](/tiup/tiup-reference.md#tiup-reference) or you can connect to your TiDB server, you can quickly generate and import sample data for the Bookshop application by running the following command:

Expand Down Expand Up @@ -75,10 +72,7 @@ tiup demo bookshop prepare --users=200000 --books=500000 --authors=100000 --rati

You can delete the original table structure through the `--drop-tables` parameter. For more parameter descriptions, run the `tiup demo bookshop --help` command.

</div>
<div label="Via TiDB Cloud Import">

### Via TiDB Cloud Import
### Method 2: Via TiDB Cloud Import

On the database details page of TiDB Cloud, click the **Import** button to enter the **Data Import Task** page. On this page, perform the following steps to import the Bookshop sample data from AWS S3 to TiDB Cloud.

Expand Down Expand Up @@ -159,9 +153,6 @@ The result is as follows:
6 rows in set (0.03 sec)
```

</div>
</SimpleTab>

## Description of the tables

This section describes the database tables of the Bookshop application in detail.
Expand Down
4 changes: 2 additions & 2 deletions develop/dev-guide-build-cluster-in-cloud.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ If you need to run TiDB on your local machine, see [Starting TiDB Locally](/quic

<div label="macOS">

Install [Homebrew](https://brew.sh/index) if you do not have it, and then run the following command to install the MySQL client:
For macOS, install [Homebrew](https://brew.sh/index) if you do not have it, and then run the following command to install the MySQL client:

{{< copyable "shell-regular" >}}

Expand Down Expand Up @@ -88,7 +88,7 @@ mysql Ver 8.0.28 for macos12.0 on arm64 (Homebrew)

<div label="Linux">

Take CentOS 7 as an example:
For Linux, the following takes CentOS 7 as an example:

{{< copyable "shell-regular" >}}

Expand Down
6 changes: 3 additions & 3 deletions develop/dev-guide-delete-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ If fewer than 10,000 records are returned, use the following example to delete t
<SimpleTab>
<div label="SQL">

{{< copyable "sql" >}}
In SQL, the example is as follows:

```sql
DELETE FROM `ratings` WHERE `rated_at` >= "2022-04-15 00:00:00" AND `rated_at` <= "2022-04-15 00:15:00";
Expand All @@ -68,7 +68,7 @@ DELETE FROM `ratings` WHERE `rated_at` >= "2022-04-15 00:00:00" AND `rated_at`

<div label="Java">

{{< copyable "" >}}
In Java, the example is as follows:

```java
// ds is an entity of com.mysql.cj.jdbc.MysqlDataSource
Expand All @@ -95,7 +95,7 @@ try (Connection connection = ds.getConnection()) {

<div label="Golang">

{{< copyable "" >}}
In Golang, the example is as follows:

```go
package main
Expand Down
4 changes: 2 additions & 2 deletions develop/dev-guide-hybrid-oltp-and-olap-queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ The [Create a table](/develop/dev-guide-create-table.md#use-htap-capabilities) s

## Data preparation

Before starting, you can import more sample data [via the `tiup demo` command](/develop/dev-guide-bookshop-schema-design.md#via-tiup-demo). For example:
Before starting, you can import more sample data [via the `tiup demo` command](/develop/dev-guide-bookshop-schema-design.md#method-1-via-tiup-demo). For example:

{{< copyable "shell-regular" >}}

```shell
tiup demo bookshop prepare --users=200000 --books=500000 --authors=100000 --ratings=1000000 --orders=1000000 --host 127.0.0.1 --port 4000 --drop-tables
```

Or you can [use the Import function of TiDB Cloud](/develop/dev-guide-bookshop-schema-design.md#via-tidb-cloud-import) to import the pre-prepared sample data.
Or you can [use the Import function of TiDB Cloud](/develop/dev-guide-bookshop-schema-design.md#method-2-via-tidb-cloud-import) to import the pre-prepared sample data.

## Window functions

Expand Down
4 changes: 2 additions & 2 deletions develop/dev-guide-optimize-sql.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ This document introduces some common reasons for slow SQL statements and techniq

## Before you begin

You can use [`tiup demo` import](/develop/dev-guide-bookshop-schema-design.md#via-tiup-demo) to prepare data:
You can use [`tiup demo` import](/develop/dev-guide-bookshop-schema-design.md#method-1-via-tiup-demo) to prepare data:

{{< copyable "shell-regular" >}}

```shell
tiup demo bookshop prepare --host 127.0.0.1 --port 4000 --books 1000000
```

Or [using the Import feature of TiDB Cloud](/develop/dev-guide-bookshop-schema-design.md#via-tidb-cloud-import) to import the pre-prepared sample data.
Or [using the Import feature of TiDB Cloud](/develop/dev-guide-bookshop-schema-design.md#method-2-via-tidb-cloud-import) to import the pre-prepared sample data.

## Issue: Full table scan

Expand Down

0 comments on commit ce57785

Please sign in to comment.