lab_code: dba_307_lab_ff2
title_en: "TiDB SQL Tuning Lab 3: Query Optimizer"
title_zh: "TiDB SQL 调优实验 3: 查询优化器"
title_ja: "TiDB SQL チューニング演習 3: クエリオプティマイザー"
title_ko: "TiDB SQL 튜닝 실습 3: 쿼리 최적화"
description_en:
  In this hands-on lab, you will examine the TiDB optimizer's execution
  plan for several different SELECT queries by using the EXPLAIN and EXPLAIN ANALYZE
  command.
description_zh: 在这个实验中，您将使用 EXPLAIN 和 EXPLAIN ANALYZE 命令检查几个不同 SELECT 查询的 TiDB 优化器执行计划。
description_ja:
  このハンズオン演習では、EXPLAIN および EXPLAIN ANALYZE コマンドを使用して、いくつかの異なる SELECT
  クエリに対する TiDB オプティマイザーの実行プランを調べます。
description_ko:
  이 실습에서는 EXPLAIN 및 EXPLAIN ANALYZE 명령을 사용하여 여러 가지 다른 SELECT 쿼리에 대한
  TiDB 최적화 실행 계획을 확인합니다.
splash_image_en: https://lab-static.pingcap.com/quick-demo/307-03.png
splash_image_zh: https://lab-static.pingcap.com/quick-demo/307-03.png
splash_image_ja: https://lab-static.pingcap.com/quick-demo/307-03.png
splash_image_ko: https://lab-static.pingcap.com/quick-demo/307-03.png
external_materials_en:
  - name: "Query Optimizer Deck Template"
    url: https://docs.google.com/presentation/d/1Fhx85jqV57kKA5tk80X6kliRPq7XzAn1/edit?slide=id.p1#slide=id.p1
    employee_only: true
external_materials_ja:
  - name: "クエリオプティマイザーデッキテンプレート"
    url: https://docs.google.com/presentation/d/1E89TvZLf7uBJrB4lip0vNuMURKhXa02P/edit?slide=id.p1#slide=id.p1
    employee_only: true
external_materials_zh:
  - name: "查询优化器演示文稿模板"
    url: https://docs.google.com/presentation/d/1Fhx85jqV57kKA5tk80X6kliRPq7XzAn1/edit?slide=id.p1#slide=id.p1
    employee_only: true
external_materials_ko:
  - name: "쿼리 최적화 템플릿"
    url: https://docs.google.com/presentation/d/1Fhx85jqV57kKA5tk80X6kliRPq7XzAn1/edit?slide=id.p1#slide=id.p1
    employee_only: true
lab_level: Intermediate
category_en:
  - Application Migration
  - SQL Tuning
category_zh:
  - 应用迁移
  - SQL 调优
category_ja:
  - アプリケーション移行
  - SQL チューニング
category_ko:
  - 애플리케이션 마이그레이션
  - SQL 튜닝
authors:
  - Fei Dong (CEG)
  - Tony Huang (CEG)
delivery_type: Instructor-Led
tidb_environments:
  - TiDB Self-Managed
tidb_versions:
  - 7.5.4
target_audience:
  - Architect
  - Developer
  - DevOps
regions:
  aws:
    - oregon
    - tokyo
    - singapore
    - frankfurt
credits: 1
credit_redeemable: true
employee_only: false
estimated_duration_minutes: 90

requirements:
  - type: CloudStack

topology:
  - role: monitor
    node_count: 1
    ssh_user: ec2-user
    web_ssh: true
  - role: pd
    node_count: 1
  - role: kv
    node_count: 3
  - role: db
    node_count: 2

bootstrap:
  - name: "prepare monitor"
    type: "ShellScript"
    target:
      - monitor1
    script: ./scripts/prepare-monitor.sh
  - name: "prepare tidb"
    type: "ShellScript"
    target:
      - monitor1
    shell: |
      set -e
      /home/ec2-user/create-cluster-vinput.sh ${TIDB_VERSION} ${REGION_NAME} ./solution-topology-seven-nodes.yaml

features:
  enable_content_explain: false
