Technical Integration Department System Analysis & Training Group Jerry Yang November 11, 2005 SQL Server 2000 Research Series  Performance Tuning
Introduction SQL Server 2000 Index Analyzing The Way to Achieve Goal Summary Agenda
Introduction SQL Server 2000 Index Analyzing The Way to Achieve Goal Summary Performance Tuning
What Is DB Tuning ? Hardware Part Software Part Why It Is So Important ? Case Study 1. General Nutrition Companies Case Study 2. SYSCOM Case Study 3. GSS Introduction
Introduction SQL Server 2000 Index Analyzing The Way to Achieve Goal Summary Performance Tuning
SQL Server Managers SQL Server 2000 Index Analyzing Query Executer
Eight Types of Disk Pages Bulk Changed Map Pages Data Pages Differential Changed Map Pages Global Allocation Map (GAM & SGAM) Pages Index Allocation Map (IAM) Pages Index Pages Page Free Space (PFS) Pages Text/Image Pages SQL Server 2000 Index Analyzing
Eight Types of Disk Pages Bulk Changed Map Pages Data Pages Differential Changed Map Pages Global Allocation Map (GAM & SGAM) Pages Index Allocation Map (IAM) Pages Index Pages Page Free Space (PFS) Pages Text/Image Pages SQL Server 2000 Index Analyzing
Concept of B-Tree Three Kinds of Nodes Root Node Intermediate Nodes Leaf Nodes Pointer Data Bookmark Real Data SQL Server 2000 Index Analyzing
SQL Server Index Types Clustered Index ─   Please See Example  ─ SQL Server 2000 Index Analyzing
SELECT  *  FROM People  WHERE  ID = 3 ID Name Sex City 1 2 3 4 Alex John Bill Mary M M M F Taipei Tainan Keelung Taipei Table Name: People Clustered Index: ID Non-Clustered Index: Name
SQL Server Index Types Non-Clustered Index ─   Please See Example   ─ SQL Server 2000 Index Analyzing
Bookmarks SELECT  *  FROM People  WHERE  Name = ‘Bill’ ID Name Sex City 1 2 3 4 Alex John Bill Mary M M M F Taipei Tainan Keelung Taipei Table Name: People Clustered Index: ID Non-Clustered Index: Name
ID Name Sex City 1 2 3 4 Alex John Bill Mary M M M F Taipei Tainan Keelung Taipei Table Name: People Clustered Index: ID Non-Clustered Index: Name
Introduction SQL Server 2000 Index Analyzing The Way to Achieve Goal Summary Performance Tuning
Index Creation Tips Frequency (Where, Order By, Group By) Selectivity Indexed Column Size (Integer, Character) OLTP (Online Transaction Processing) & OLAP (Online Analytical Processing) The Way to Achieve Goal
Query Design Tips Use Index Ex: Column Employee_ID is used to define an index. The Statement “… WHERE Employee_ID >= 50” will use this index. Use “>=” And “<=” To Replace… BETWEEN … AND … <> , != Avoid To Use Calculation In WHERE Clause Ex: WHERE Last_Name + First_Name = ‘George Bush’ The Way to Achieve Goal
Query Design Tips (Cont.) Avoid To Use Function In WHERE Clause Ex: WHERE ABS(Account_Money) >= 50000 Follow SQL Server’s Decision The Way to Achieve Goal
Introduction SQL Server 2000 Index Analyzing The Way to Achieve Goal Summary Performance Tuning
What Do You Need To Know Today… Something About DB Tuning Analysis of Index B-Tree Pages Clustered Index Non-Clustered Index Index & Query Design Tips Summary
Fundamentals of Database Systems Author:   Elmasri / Navathe Publisher: Addison-Wesley Publishing Company Inside of Microsoft SQL Server 2000 Author:   Kalen Delaney Publisher: Microsoft Press Reference
Any Question?

SQL Server 2000 Research Series - Performance Tuning

  • 1.
    Technical Integration DepartmentSystem Analysis & Training Group Jerry Yang November 11, 2005 SQL Server 2000 Research Series Performance Tuning
  • 2.
    Introduction SQL Server2000 Index Analyzing The Way to Achieve Goal Summary Agenda
  • 3.
    Introduction SQL Server2000 Index Analyzing The Way to Achieve Goal Summary Performance Tuning
  • 4.
    What Is DBTuning ? Hardware Part Software Part Why It Is So Important ? Case Study 1. General Nutrition Companies Case Study 2. SYSCOM Case Study 3. GSS Introduction
  • 5.
    Introduction SQL Server2000 Index Analyzing The Way to Achieve Goal Summary Performance Tuning
  • 6.
    SQL Server ManagersSQL Server 2000 Index Analyzing Query Executer
  • 7.
    Eight Types ofDisk Pages Bulk Changed Map Pages Data Pages Differential Changed Map Pages Global Allocation Map (GAM & SGAM) Pages Index Allocation Map (IAM) Pages Index Pages Page Free Space (PFS) Pages Text/Image Pages SQL Server 2000 Index Analyzing
  • 8.
    Eight Types ofDisk Pages Bulk Changed Map Pages Data Pages Differential Changed Map Pages Global Allocation Map (GAM & SGAM) Pages Index Allocation Map (IAM) Pages Index Pages Page Free Space (PFS) Pages Text/Image Pages SQL Server 2000 Index Analyzing
  • 9.
    Concept of B-TreeThree Kinds of Nodes Root Node Intermediate Nodes Leaf Nodes Pointer Data Bookmark Real Data SQL Server 2000 Index Analyzing
  • 10.
    SQL Server IndexTypes Clustered Index ─ Please See Example ─ SQL Server 2000 Index Analyzing
  • 11.
    SELECT * FROM People WHERE ID = 3 ID Name Sex City 1 2 3 4 Alex John Bill Mary M M M F Taipei Tainan Keelung Taipei Table Name: People Clustered Index: ID Non-Clustered Index: Name
  • 12.
    SQL Server IndexTypes Non-Clustered Index ─ Please See Example ─ SQL Server 2000 Index Analyzing
  • 13.
    Bookmarks SELECT * FROM People WHERE Name = ‘Bill’ ID Name Sex City 1 2 3 4 Alex John Bill Mary M M M F Taipei Tainan Keelung Taipei Table Name: People Clustered Index: ID Non-Clustered Index: Name
  • 14.
    ID Name SexCity 1 2 3 4 Alex John Bill Mary M M M F Taipei Tainan Keelung Taipei Table Name: People Clustered Index: ID Non-Clustered Index: Name
  • 15.
    Introduction SQL Server2000 Index Analyzing The Way to Achieve Goal Summary Performance Tuning
  • 16.
    Index Creation TipsFrequency (Where, Order By, Group By) Selectivity Indexed Column Size (Integer, Character) OLTP (Online Transaction Processing) & OLAP (Online Analytical Processing) The Way to Achieve Goal
  • 17.
    Query Design TipsUse Index Ex: Column Employee_ID is used to define an index. The Statement “… WHERE Employee_ID >= 50” will use this index. Use “>=” And “<=” To Replace… BETWEEN … AND … <> , != Avoid To Use Calculation In WHERE Clause Ex: WHERE Last_Name + First_Name = ‘George Bush’ The Way to Achieve Goal
  • 18.
    Query Design Tips(Cont.) Avoid To Use Function In WHERE Clause Ex: WHERE ABS(Account_Money) >= 50000 Follow SQL Server’s Decision The Way to Achieve Goal
  • 19.
    Introduction SQL Server2000 Index Analyzing The Way to Achieve Goal Summary Performance Tuning
  • 20.
    What Do YouNeed To Know Today… Something About DB Tuning Analysis of Index B-Tree Pages Clustered Index Non-Clustered Index Index & Query Design Tips Summary
  • 21.
    Fundamentals of DatabaseSystems Author: Elmasri / Navathe Publisher: Addison-Wesley Publishing Company Inside of Microsoft SQL Server 2000 Author: Kalen Delaney Publisher: Microsoft Press Reference
  • 22.