dat329 microsoft sql server always-on technologies...

30

Upload: hadieu

Post on 08-Jun-2018

222 views

Category:

Documents


0 download

TRANSCRIPT

Performance Optimization Overview

Design

• Logical DB

design

optimization

(normalization

,

index/primary

key choice

etc.)

Build

• Query

tuning

• Database

physical

optimization

(index etc.)

Test &

Deployment

• Database

physical

optimization

(index,

database

physical

design, etc.)

• System

resource

optimization

Operate

• Database &

system

monitoring

• Resource

optimization

Query Tuning

SQL-OS (Schedulers, Buffer Pool, Memory

Management, Synchronization Primitives, …)

Language Processing (Parse/Bind/View Expansion)

Statement/Batch

Execution

Plan Cache Management

Storage Engine (Access Methods, Database Page

Cache, Locking, Transactions, …)

Query Optimization

(Plan Generation, Index

Selection, Join Ordering,

Statistics, Costing) Query Execution

(Query Operators,

Memory Grants,

Parallelism)

Utilitie

s (DB

CC

,

Back

up

/ Resto

re, B

CP, …

) M

eta

data

, Typ

e s

yst

em

, Exp

ress

ion

Serv

ices

You

are

here

Query Tuning Examples

OR is similar to UNION

Be sure to test this thoroughly as your queries are semantically different when you change from OR to UNION.

Table1 Table2

SARG1

Join Col PK

SARG2

Join Col FK

Do you already have

individual indexes on

each and all of these

columns?

Foreign Key???

Still not working? Table1 Table2

SARG1

Join Col PK

SARG2

Join Col FK

Table1 Table2

SARG1

Join Col PK

SARG2

Join Col FK