EngineeringSenior DeveloperTraining Sessions

Session 16: SQL Server Tuning Mindset

Premium

"Đừng chỉ viết câu query chạy được. Hãy viết câu query mà SQL Server có thể hiểu và tối ưu được."

1️⃣ Tư Duy Về Query Optimizer (QO)

Query Optimizer của SQL Server là một cỗ máy dựa trên chi phí (Cost-Based). Nó không tìm ra execution plan "hoàn hảo nhất" vì việc tính toán mọi trường hợp sẽ mất quá nhiều thời gian. Nó tìm ra plan đủ tốt (Good Enough Plan) dựa trên Statistics hiện có.

  • Sai lầm thường gặp: Developer nghĩ rằng dùng INDEX A thì SQL Server chắc chắn phải dùng Index A.
Premium

Continue with premium access

Session 16: SQL Server Tuning Mindset is part of the premium library. Sign in with a premium account to unlock the full lesson and the rest of this track.

01 Full premium lesson access
02 Deeper implementation notes
03 Ongoing content updates