A Shot of SQLEspresso

SQL Blogs by Monica Morehouse (Rathbun)

  • Home
  • Session Downloads
  • Event Calendar
  • PASS
    • Hampton Roads SQL User Group
    • SQL Saturday
    • PASS WIT VC
  • DCAC
  • Contact Me
    • Disclaimer
  • Home
  • Session Downloads
  • Event Calendar
  • PASS
    • Hampton Roads SQL User Group
    • SQL Saturday
    • PASS WIT VC
  • DCAC
  • Contact Me
    • Disclaimer

No Widgets found in the Sidebar Alt!

  • Azure

    Caution When Dropping Unused Indexes on an Azure SQL Database

    August 12, 2020 /

    Index Maintenance is an important aspect of database health. Above and beyond regular index rebuilds and reorganizations it is important to understand the usage of the indexes on your database. Cleaning up unused indexes can save a lot of overhead on Insert/Update/Delete operations. To achieve that goal, I typically run a script like the one shown below and check out whether or not an index has had any seeks or scans against it as a starting point in my cleanup regiment. SELECT d.name,        OBJECT_NAME(i.[object_id]) AS [ObjectName],        i.[name] AS [IndexName],        s.user_seeks,        s.user_scans FROM sys.indexes AS i     LEFT OUTER JOIN sys.dm_db_index_usage_stats AS s         ON i.[object_id] =…

    Read More
    Monica Morehouse (Rathbun)

    Related Posts

    The New Public Speaking

    April 29, 2020

    Hide and Group Columns in SSRS Using a Parameter

    December 9, 2016

    Solving SQL Server Mysteries with a Whole Gang of Sleuths -Scooby Dooing Episode 4

    September 10, 2025
  • Azure

    What is Azure SQL Database Serverless?

    July 1, 2020 /

    What is Azure SQL Database Serverless? When I hear the term serverless my mind gets confused. How can a database exist without a server? Azure is a cloud platform, is my database just floating in the air? No, I am not really thinking that, but still the word serverless can be hard to understand. So, let’s walk through what it is. Serverless is a term commonly used for function as a service patterns like Amazon Lambda, or Azure Functions, where you have a piece of code that is called and executed without you deploying any infrastructure. Azure Logic Apps are another version of this—a program that exists to do a…

    Read More
    Monica Morehouse (Rathbun)

    Related Posts

    What does this little check box do? Query Governor SQL Database Setting

    September 13, 2017

    Filtered Index Basics

    May 22, 2019

    SQL Index Creation Using DROP EXISTING= ON

    February 17, 2021
  • Performance Tuning

    What is Batch Mode on Rowstore in SQL Server?

    June 16, 2020 /

    Under compatibility level 150, in both SQL Server 2019 and Azure SQL Database, you now can use batch mode for CPU-bound analytic type workloads without requiring columnstore indexes. There is no action needed to turn on batch mode aside from being on the proper compatibility mode. You also have the ability to enable it as a database scoped configuration option (as shown below), and you can hint individual queries to either use or not use batch mode (also shown below). If you recall in my earlier blogs on columnstore, it is batch mode in conjunction with page compression that drastically increases query performance. This feature, Batch Mode on Rowstore, allows…

    Read More
    Monica Morehouse (Rathbun)

    Related Posts

    Solving SQL Server Mysteries with a Whole Gang of Sleuths -Scooby Dooing Episode 4

    September 10, 2025

    Ruh-Roh! SQL Server 2025 Finally Brings Us a Free Standard Developer Edition – Scooby Dooing Episode 2

    August 28, 2025

    The Case for Scooby-Dooing: Solving SQL Server Mysteries Like a Pro– Scooby Dooing Episode 8

    October 8, 2025
  • Performance Tuning

    Coding Standards Gone Bad in SQL Server

    April 21, 2020 /

    Knowing your data is very important when it comes to writing code. Now I’ll admit that I am very far from being a developer, however as a DBA, I spend much of my day’s performance tuning code. In doing so, I get to see many ways code can introduce excess database reads. One of the most recent things I have come across has to do with NULLs. The environment I was working in had no default values in their table design, so it was riddled with NULL values. Over the years they had implemented coding standards to try and mitigate these NULL values within their code. In every column search…

    Read More
    Monica Morehouse (Rathbun)

    Related Posts

    Static Data Masking (SSMS 18.0 Preview)

    December 19, 2018

    How Your Hypervisor Can Impact Your CPU

    March 6, 2019

    Replication Max Text Length

    June 20, 2018
  • Azure

    Moving Your SQL Workload to the Cloud   

    March 25, 2020 /

    Every day, more IT organizations decide to move their SQL Server databases to Azure. In fact, over a million on-premises SQL Server databases have been moved to Azure. There’s an interesting blog about how Microsoft is faster and cheaper than its competitors that’s worth a read. To assist with your move to Azure Microsoft offers a number of migration tools and services to make this move as smooth as possible which I think attributes to their success. Two of those options are below with some informational links. If you’re migrating a number of large SQL Server instances, Azure Database Migration Service  is the best way to migrate databases to Azure…

    Read More
    Monica Morehouse (Rathbun)

    Related Posts

    The FAST number_rows Query Hint

    October 16, 2019

    Introduction to the performance features on SQL Server on Linux

    December 4, 2019

    The Case of the Forgotten Compatibility Mode – Scooby Dooing Episode 3

    September 3, 2025
  • Performance Tuning

    String Split Function in SQL Server

    February 12, 2020 /

    Did you know that a native STRING_SPLIT function built into SQL Server was added into SQL Server 2016? As a consultant I see so much code that call out to a scalar function that are used to split out string delimited variables into a usable list. For those that use this method I suggest you look at this function. STRING_SPLIT is a table valued function that returns a single column of your string values split out by the delimiter. This is an unusual bit of T-SQL, in that compatibility level 130 or higher is required for its use (Microsoft didn’t want to induce breaking changes into existing user code). Using…

    Read More
    Monica Morehouse (Rathbun)

    Related Posts

    Approximate COUNT DISTINCT

    January 3, 2019

    QUICK & DIRTY: Table name change for all stored procedures

    December 10, 2015

    Why DBAs Still Need to Know the Foundations of SQL Server

    August 19, 2025
  • Performance Tuning

    Sorting in Stored Procedures – Food for Thought

    January 29, 2020 /

    We know that sorting can be one of the most expensive things in an execution plan as shown below. However,  we continue to do ORDER BYs repeatedly. Yes, I 100% agree that there is a need to sort a results set and that this should be done in the procedure for good reason, but my concern is having  multiple sorts, erroneous sorts, and the sorts that can be done elsewhere. These are the ones that waste resources and can stifle performance. Many of us writing procedures tend to write in code blocks. We write the SELECT, JOINS, FROMs and WHERES then immediately follow it up with and ORDER BY as…

    Read More
    Monica Morehouse (Rathbun)

    Related Posts

    How Your Hypervisor Can Impact Your CPU

    March 6, 2019

    Admit You Can’t Do Everything

    September 28, 2015

    Query Predicates in SQL Server

    May 24, 2018
  • Performance Tuning

    In Memory Table Indexes

    January 22, 2020 /

    Now that I have written about In-Memory Tables and Migrating to In-Memory tables, let’s look at indexes and how they are created and how they work within those tables. As you can imagine indexes, called memory optimized indexes are different for these types of tables, so let’s see just how different that are from regular tables. Before we dive into this subject it is VERY important to note the biggest differences. First,  If you are running SQL Server 2014 memory optimized indexes MUST be created when the table is created or migrated. You cannot add indexes in an existing table without dropping and recreating the table. After 2016 you now…

    Read More
    Monica Morehouse (Rathbun)

    Related Posts

    What is Automatic Tuning in Azure SQL Database

    August 28, 2018

    Change Azure SQL Database Service Level Objectives in SSMS

    August 28, 2020

    How Your Hypervisor Can Impact Your CPU

    March 6, 2019
  • Performance Tuning

    Memory Optimizer Advisor

    January 15, 2020 /

    Previously I wrote about In-Memory Optimized Tables, in this blog I am going to discuss how to determine which tables could benefit from being In-Memory by using a tool called Memory Optimization Advisor (MOA). This a is a tool built into SQL Server Management Studio (SSMS) that will inform you of which tables could benefit  using In Memory OLTP capabilities and which may have non supported features. Once identified, MOA will help you to actually migrate that table and data to be optimized. Let’s see how it works by walking through it using a table I use for demonstrations in AdventureWorks2016CTP3. Since this is a smaller table and doesn’t incur…

    Read More
    Monica Morehouse (Rathbun)

    Related Posts

    SQL Index Creation Using DROP EXISTING= ON

    February 17, 2021

    TIL: Microsoft Azure Part 1

    May 17, 2017

    Invest in Yourself Stop Making Excuses

    October 22, 2019
  • Performance Tuning

    Memory Optimized Tables in SQL Server

    January 8, 2020 /

    Sometimes when I try to learn about a concept my brain blocks out everything about it. Talking about anything that uses the “In Memory” concept tends to do this to me on occasion. It’s important to note that “In Memory” is a marketing term for a series of features in SQL Server that have common behaviors but are not inherently related. So, in my next few blogs I am going to attempt to explain some In-Memory concepts as it relates to SQL Server starting with a dive into Memory Optimized Tables. I’ve already written about Columnstore which has vastly different use cases to In Memory OLTP, and you can find…

    Read More
    Monica Morehouse (Rathbun)

    Related Posts

    The Case of the Forgotten Compatibility Mode – Scooby Dooing Episode 3

    September 3, 2025

    November #SQLChat – How to Build your Name Recognition and SQL Network

    November 12, 2015

    Are My SQL Server Indexes Being Used?

    August 28, 2019
12345

About Me

Monica Morehouse (Rathbun)

Microsoft MVP, Performancing Tuning Expert, Leader Hampton Roads SQL Server User Group, Read More…

Consulting

Sessions List

Favorite Tidbits

  • Reminder to Developers

Topic Categories

  • Azure
  • Back to Basics
  • Configurations
  • Data Masking
  • DevOps
  • Encryption
  • Idera Ace
  • Important Links
  • Indexes
  • Lone DBA
  • Misc
  • MVP
  • New SQL Version
  • Performance Tuning
  • Posts with Scripts
  • Problems & Solutions
  • Quick and Dirty
  • Security
  • Speaking
  • SQL Family
  • SQLSaturday
  • SSRS
  • Summit
  • Training
  • TSQL Tuesday
  • Uncategorized

Top Posts & Pages

  • Resizing Tempdb (When TEMPDB Wont Shrink)
    Resizing Tempdb (When TEMPDB Wont Shrink)
  • What’s a Key Lookup?
    What’s a Key Lookup?
  • It's All in the Name, Index Naming Conventions
    It's All in the Name, Index Naming Conventions
  • Tempdb Performance Improvements in SQL Server 2022 are Dramatic
    Tempdb Performance Improvements in SQL Server 2022 are Dramatic
  • Memory Optimized Tables in SQL Server
    Memory Optimized Tables in SQL Server
  • How to get started with Always Encrypted for Beginners Part 1
    How to get started with Always Encrypted for Beginners Part 1
  • The Mystery of the Locked-Up Database -Scooby Dooing Episode 6
    The Mystery of the Locked-Up Database -Scooby Dooing Episode 6
  • Understanding Columnstore Indexes in SQL Server Part 2
    Understanding Columnstore Indexes in SQL Server Part 2
  • The Case for Scooby-Dooing: Solving SQL Server Mysteries Like a Pro– Scooby Dooing Episode 8
    The Case for Scooby-Dooing: Solving SQL Server Mysteries Like a Pro– Scooby Dooing Episode 8
  • DMV’s for the Beginner
    DMV’s for the Beginner
Graceful Pro Theme by Optima Themes - 2026 ©
 

Loading Comments...