MySQL 8.4 Query Optimization 1.5 | Course Roadmap & the Lab Database (ddt_lab)

1 Video View·Nov 8, 2026  #MySQL #MySQL84 #QueryOptimization

Where this MySQL 8.4 course goes — 12 modules in 6 stages — and a first look at ddt_lab, the 41-million-row lab database behind every demo.

We walk through the learning path from "why indexes matter" to a full end-to-end optimization workshop, then open the lab database on a real MySQL 8.4.7 server: seven tables, how they connect, and why it deliberately starts with no foreign keys and almost no indexes.

⏱️ Chapters
0:00 Where we are in the course
0:15 Roadmap: 12 modules, 6 stages
1:18 The lab database: ddt_lab on MySQL 8.4.7
1:55 How the tables connect — no foreign keys, PK only
2:29 Skewed on purpose, like real data
2:48 Build ddt_lab on your own server
2:56 Next: Module 2 — how InnoDB stores a table

📌 What you'll learn
• The 6 stages of the course: motivate → understand → design → verify → optimize → production
• The 4 core tables: customers (1 M rows), products (100 K), orders (10 M), order_items (~30 M)
• Why orders and order_items start with no secondary indexes and no foreign keys — a FOREIGN KEY would silently create an index
• Why the data is skewed on purpose (28% of customers in the US, ~92% of orders delivered), and why that matters to the optimizer

🧪 Build the lab yourself
[Paste the link to the ddt_lab scripts here]
ddt_lab_01_schema.sql · ddt_lab_02_generate.sql · ddt_lab_03_verify.sql

📚 This course: MySQL 8.4 Query Optimization
Module 1 · Episode 1.5
◀ Previous: 1.4 What Changed in 8.4 for Query Optimization
▶ Next: 2.1 How InnoDB Stores a Table

▶ Series: MySQL 8.4 Indexing & Query Optimization — new parts are added to the playlist as they are released.
👍 If this helped, like, subscribe, and tell me in the comments which topic you want next.

──────────
【中文說明】
這門 MySQL 8.4 課程會怎麼走?12 個 Module、分成 6 個階段。這一集也帶你第一次認識 ddt_lab,就是之後每個示範都會用到、共約 4,100 萬筆資料的實驗資料庫。

我們從「為什麼需要索引」一路講到最後的完整優化實作,然後在真實的 MySQL 8.4.7 伺服器上打開實驗資料庫:7 張表、彼此怎麼關聯,以及為什麼它刻意從沒有外鍵、幾乎沒有索引的狀態開始。

📌 這一集會學到
・課程的 6 個階段:動機 → 理解 → 設計 → 驗證 → 優化 → 上線實戰
・4 張核心表:customers(100 萬筆)、products(10 萬筆)、orders(1,000 萬筆)、order_items(約 3,000 萬筆)
・為什麼 orders 和 order_items 一開始沒有二級索引、也沒有外鍵:FOREIGN KEY 會自動建立索引
・為什麼資料刻意做成傾斜分布(28% 的客戶在美國、約 92% 的訂單是 delivered),以及這對優化器的影響

🧪 自己建立實驗資料庫
[在這裡貼上 ddt_lab 腳本的連結]
ddt_lab_01_schema.sql・ddt_lab_02_generate.sql・ddt_lab_03_verify.sql

📚 本課程:MySQL 8.4 查詢優化
Module 1・第 1.5 集
◀ 上一集:1.4 MySQL 8.4 對查詢優化的改變
▶ 下一集:2.1 InnoDB 怎麼儲存一張表

▶ 系列:MySQL 8.4 索引與查詢優化,新的單元會陸續加進播放清單。
👍 覺得有幫助的話,歡迎按讚、訂閱,也可以在留言告訴我你想看哪個主題。

──────────

MySQL is a registered trademark of Oracle Corporation and/or its affiliates. This channel is not affiliated with or endorsed by Oracle.

Fonts:
• MOE Lishu Font (教育部隸書), Ministry of Education, R.O.C. (Taiwan), licensed under CC BY-ND 3.0 TW
• Inter (SIL Open Font License), DejaVu Sans Mono (DejaVu Fonts License)

This video is for educational purposes only. Please refer to the official MySQL documentation for production use.

© 2026 龍博士 Doctor Dragon Tech 版權所有
本影片的動畫、圖表、旁白與頻道標誌皆為原創製作。未經許可,請勿轉載、重製或用於商業用途;歡迎分享影片連結。

MySQL 是 Oracle Corporation 及/或其關係企業的註冊商標。本頻道與 Oracle 沒有任何關係,本影片也不是 Oracle 官方內容。

使用字體:
・教育部隸書,中華民國教育部,依「創用 CC 姓名標示-禁止改作 3.0 臺灣」授權使用
・Inter(SIL Open Font License)、DejaVu Sans Mono(DejaVu Fonts License)

本影片內容僅供學習參考,實際操作請以 MySQL 官方文件為準。

#MySQL #MySQL84 #QueryOptimization