Execution-Plan

Uso "nascosto" del tempdb

Qualche settimana fa, mentre ero al lavoro, mi sono ritrovato a dover risolvere un problema apparentemente non molto strano, ma che tuttavia nasconde qualche retroscena interessante. I fatti sono stati più o meno questi:

Circa a metà mattinata mi è stato segnalato un problema di prestazioni su uno dei sistemi che abbiamo in gestione nel nostro team di lavoro; dopo alcuni semplici controlli è stato subito chiaro che il rallentamento era sostanzialmente dovuto ad un problema di contency sul tempdb. “Beh.. abbastanza semplice!” - ho subito pensato! - “la colpa è mia perché (ahi ahi ahi) non ho ancora fatto lo split del file dati sul tempdb!”.

Skewed Data - Poor Cardinality Estimates... and Plans Gone Bad

Sergio Govoni

Sul canale SQLPASS TV è stata pubblicata la sessione “Skewed Data, Poor Cardinality Estimates, and Plans Gone Bad” tenuta da Kimberly Tripp (@KimberlyLTripp) durante lo scorso PASS Summit 2013.

Abstract

When data distribution is heavily skewed, cardinality estimation (how many rows the query optimizer expects each operator to process) can be wildly incorrect, resulting in poor quality query plans and degraded performance. You’ve probably seen the advice to update all statistics if a query plan looks wrong - but is that the right advice? In many cases, no! These are “sledgehammer” approaches, and while they might solve some problems (usually parameter sniffing problems), they don’t solve the actual problem. In this session, you’ll learn a generalized yet tailored-to-the-table way to solve query plan quality problems for very large tables (VLTs). Topics will include creating, using, and updating filtered statistics; using forced parameterization and templatized plan guides; and understanding stored procedures and how they can leverage filtered statistics.