lab_code: dba_307_lab_ff5
title_en: "TiDB SQL Tuning Lab 6: Optimizer Hints and SQL Plan Management (SPM)"
title_zh: "TiDB SQL 调优实验 6: 优化器提示和 SQL 执行计划管理 (SPM)"
title_ja: "TiDB SQL チューニング演習 6: オプティマイザヒントと SQL プラン管理（SPM）"
title_ko: "TiDB SQL 튜닝 실습 6: 최적화 힌트와 SQL 실행 계획 관리 (SPM)"
description_en:
  In this hands-on lab, you use SQL hints and SQL Plan Management (SPM)
  to selection a specific execution plan.
description_zh: 在这个实验中，您将使用 SQL 提示和 SQL 执行计划管理（SPM）选择特定的执行计划。
description_ja: このハンズオン演習では、SQL ヒントと SQL プラン管理（SPM）を使用して特定の実行計画を選択します。
description_ko: 이 실습에서는 SQL 힌트와 SQL 실행 계획 관리(SPM)를 사용하여 특정 실행 계획을 선택합니다.
splash_image_en: https://lab-static.pingcap.com/quick-demo/307-06.png
splash_image_zh: https://lab-static.pingcap.com/quick-demo/307-06.png
splash_image_ja: https://lab-static.pingcap.com/quick-demo/307-06.png
splash_image_ko: https://lab-static.pingcap.com/quick-demo/307-06.png
external_materials_en:
  - name: "SQL Plan Management (SPM) Deck Template"
    url: https://docs.google.com/presentation/d/1qvo7A_dUNN-HjFLv_2JSkKnzdJTisyC0/edit?slide=id.p1#slide=id.p1
    employee_only: true
external_materials_ja:
  - name: "SQL プラン管理（SPM）デッキテンプレート"
    url: https://docs.google.com/presentation/d/13oQUmwoV9G9V2pwjtVAeXYX19P1PbIoR/edit?slide=id.p1#slide=id.p1
    employee_only: true
external_materials_zh:
  - name: "SQL 执行计划管理 (SPM) 演示文稿模板"
    url: https://docs.google.com/presentation/d/1qvo7A_dUNN-HjFLv_2JSkKnzdJTisyC0/edit?slide=id.p1#slide=id.p1
    employee_only: true
external_materials_ko:
  - name: "SQL 실행 계획 관리 (SPM) 실습 템플릿"
    url: https://docs.google.com/presentation/d/1qvo7A_dUNN-HjFLv_2JSkKnzdJTisyC0/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
  enable_environment_variables_fallback: true
