It appears that your browser does not support JavaScript, or you have it disabled. This site is best viewed with JavaScript enabled. If JavaScript is disabled in your browser, please turn it back on then reload this page. If your browser does not support JavaScript, click here for a page that doesn't require javascript.

TSQL Performance Recommendations

SQL Server optimizer doesn't use and index seek for execution of your query although the quera is high selective?What is better, when and why: LIKE vs: SUBSTRING, IN vs. EXISTS, SUBQUERY vs. JOIN. Why you should not use the UPPER or LOWER functions? How to avoid non-SARG-able WHERE clauses?

In this section we will answer these questions and show how bad designed queries lead to poor execution plans. We will offer recommendations and tips how to avoid performance problems caused by poor query design (functions in WHERE clause, data type conversions…) and explain how local variables and parameters affect the generation of execution plan. We will discuss and compare different query approaches and operators (IN vs. EXISTS, EXISTS vs. COUNT(*), UNION vs. UNION ALL, IN vs. BETWEEN…) and give appropriate recommendations. We’ll also cover database constraints from the performance point of view.

Milos Radivojevic is a database developer and consultant, speaker, and trainer located in Vienna, Austria. He has been working with SQL Server over 12 years. He is Microsoft SQL Server MVP and MCT and specializes in SQL Server for application developers and performance and query tuning. Currently he works as senior database developer in bwin.party (the largest regulated online gaming company in the world) where he works with some of the largest SQL Server databases. He is co-leader of the SQL Server PASS Austria. He is a speaker in international conferences (SQLBits, SQL Saturday, SQLU Summit) and speaks regularly at SQL Server PASS Austria meetings. He has developed two courses: SQL Server For Application Developers and (for SolidQ) SQL Server 2012 for Experienced Developers and DBAs (Co-author with Herbert Albert and Gianluca Hotz). His Twitter handle is @MilosSQL.