Transcript
Page 1: How to solve a SQL performance problem Paul Zgondea

How to solve a SQL performance problemPaul Zgondea

Page 2: How to solve a SQL performance problem Paul Zgondea

Agenda

• DBA monitoring tools• Finding the culprit • Optimization time

Page 3: How to solve a SQL performance problem Paul Zgondea

First Response of a DBA

• What do you do when somebody asks you to investigate what’s stressing out the SQL server? • What tools do you use ? • What do you do when the SQL Server is too busy to accept your

connection ?

Page 4: How to solve a SQL performance problem Paul Zgondea

Dedicated Admin Connection

• Enable DACEXEC sp_configure 'remote admin connections', 1;GORECONFIGUREGO

Page 5: How to solve a SQL performance problem Paul Zgondea

sp_whoisactive by Adam Machanic

• Alternative for sp_who and sp_who2 • Why it’s better: • Runs quickly and does not use a lot of resources.• Shows only the active queries (no sleeping and system processes)• Shows how long the queries have been running for• Shows the formatted SQL Text and Plan (@get_plans = 1)• Shows waits information • Shows CPU, Tempdb information,

Page 6: How to solve a SQL performance problem Paul Zgondea

DEMO TIME

Page 7: How to solve a SQL performance problem Paul Zgondea

Capture the events

• Extended events – fast, asynchronous – steep learning curve. • SQL Trace / Profiler – old method but still used – synchronous and it

adds extra load on the server.

Page 8: How to solve a SQL performance problem Paul Zgondea

Analyze the captured data

• Retrieve the captured data• Filter, clean and group data so we can analyze it accordingly • Identify the most resource intensive queries

Page 9: How to solve a SQL performance problem Paul Zgondea

Optimization time!

• Execution plan • Indexes • Re-writes • Testing the final result

Page 10: How to solve a SQL performance problem Paul Zgondea

DEMO TIME

Page 11: How to solve a SQL performance problem Paul Zgondea
Page 12: How to solve a SQL performance problem Paul Zgondea

Thank you for attending!

Resources will be available soon on WWW.SQLCLUJ.COM


Top Related