Problems displaying this newsletter? View online.
SQL Server Central
Featured Contents
Question of the Day
The Voice of the DBA
 

Own Your Mistakes

Hello, Grant again as Steve is on sabbatical.

My evenings and weekends are currently being used to update my SQL Server query performance book for 2025. I really enjoy it because writing the book forces me to structure my learning on SQL Server 2025, not just hit it in some slipshod manner. Plus, I've got a technical editor behind me that's going to ensure I cover things appropriately. It's all good.

But...

Earlier this week while working my way through a chapter I came across this little bit of joy:

Also, the execution time for the query went from X on average to X.

I double checked. Yep. It's in print. Page 271 of the 2022 version of the book if you're interested. I was clearly intending to measure some performance metrics and report back and just forgot. This kind of thing is just mortifying. However, it's my mistake. Thankfully, this is a tiny one, hardly going to break stuff for people. It's not like I offered up bad advice... this time. See, I've done that too. Way back, WAY back, first time I wrote a book, on SQL Server 2005 execution plans, I helped perpetuate a myth. I made a huge stink about how "Estimated" plans were just not really good. You want "Actual" plans. Problem is, in SQL Server, an execution plan is an execution plan. Oh, you can capture runtime metrics and add them to the execution plan. That's what we call an "Actual" plan. It's just a plan, same as the "Estimated" plan, but it has extra runtime metrics. Really, except for those runtime metrics, there are no differences between what we call an Actual Plan and an Estimated Plan. At the time, I didn't know enough to explain it properly. I've subsequently fixed it, but, I've got to own that mistake.

If we all owned up when we made an error, I'm sure there'd be just a little less conflict going on in the office. No one is 100% right, 100% of the time. We all fall short. I'm just old enough to have a longer list than most. Anyway, admit the error. Correct it if possible. Pick yourself up. Brush off your bruised ego, and keep going. That's how I'm going about it.

Grant Fritchey

Join the debate, and respond to today's editorial on the forums

 
  Featured Contents
SQLServerCentral Article

Automating SQL Server Inventory Collection with SQLInventory

Deepam Ghosh from SQLServerCentral

Learn about a free inventory tool to help you keep track of basic information on your servers.

External Article

DISTINCT and UNION: What happens when you use them together?

Additional Articles from SimpleTalk

When I was perusing my LinkedIn feed the other day, I came across this thread about using SELECT *. In one of the replies, Aaron Cutshall noted that: “Another real performance killer is SELECT DISTINCT especially when combined with UNION. I have a whole list of commonly used hidden performance killers!”

Blog Post

From the SQL Server Central Blogs - Exploring the Next Gen General Purpose Tier in Azure SQL Managed Instance

John Morehouse from John Morehouse | Sqlrus.com

In a recent video, I took a hands-on look at the Next Gen General Purpose service tier in Azure SQL Managed Instance—and it brings some exciting advancements to the...

Blog Post

From the SQL Server Central Blogs - Moving to Rancher Desktop

Steve Jones - SSC Editor from The Voice of the DBA

I’ve been very happy with Docker Desktop for years, running it on both laptop and desktop. However, a corporate decision was made to move to Rancher Desktop, so I...

Pro SQL Server 2022 Wait Statistics: A Practical Guide to Analyzing Performance in SQL Server and Azure SQL Database

Site Owners from SQLServerCentral

Use this practical guide to analyze and troubleshoot SQL Server performance using wait statistics. You'll learn to identify precisely why your queries are running slowly. And you'll know how to measure the amount of time consumed by each bottleneck so you can focus attention on making the largest improvements first. This edition is updated to cover analysis of wait statistics current with SQL Server 2022. Whether you are new to wait statistics, or already familiar with them, this book provides a deeper understanding on how wait statistics are generated and what they mean for your SQL Server instance’s performance. 

 

  Question of the Day

Today's question (by Steve Jones - SSC Editor):

 

Independence Day

The film independence day was released in 1996. Which of these queries returns that year is run today?

Think you know the answer? Click here, and find out if you are right.

 

 

  Yesterday's Question of the Day (by Steve Jones - SSC Editor)

Adding More Data To Sample Databases

I have installed the WideWorldImporters database from Microsoft on my SQL Server 2022 system. There is some data included, but it's all from before 2013. How can I more quickly add more random data to my sample database?

Answer: Run DataLoadSimulation.PopulateDataToCurrentDate in WideWorldImporters to get data through the current date.

Explanation: There is a data generator built into the database. Ref: Data Generation in WideWorldImporters - https://learn.microsoft.com/en-us/sql/samples/wide-world-importers-generate-data?view=sql-server-ver16

Discuss this question and answer on the forums

 

 

 

Database Pros Who Need Your Help

Here's a few of the new posts today on the forums. To see more, visit the forums.


SQL Server 2019 - Administration
Batchmode execution in SQL 2019 - Is there a way to force a query to use Batchmode execution, my database is in 2019 compatibility mode. For some reason, my queries are not using batch mode even when its scanning through millions of rows. Is there a query hint or in anyway to force it to use Batch mode execution (SQL server […]
Migrating Temporal/systemversioned Tables - Hello, for my client i have to do regular refreshes of production to dev. We have been automating this in the belief the full DB has to be refreshed but now we are asked to keep certain schemas from dev when refreshing. These schemas have together around 25 temporal Tables which i have written about […]
SQL Server 2019 - Development
is there a way to have a table sorted automatically? - Hi Everyone I have one table that has a unique requirement to be sorted in order for the table to have any value.  I remember the sort order now but in the future I may forget the order and have to spend time to figure out why the data doesn't look right in the table.  […]
BULK INSERT question - Hi everyone I have a text file that I want to import into SS table.  I can import the file but the problem is that order isn't preserved.  Suppose the file has below entries: Line1 Line2 Line3 When the above gets imported into SS table it is presenting them as Line2 Line3 Line1 The order […]
SUM([value]) and highest record type - Given a record mapping table: Id Initial Updated 1 1 2 2 3 4 3 6 5 and a data table: Id Model RecordType Value 1 1 1 3.00 2 1 2 5.00 3 2 3 2.00 4 3 6 1.00 5 3 5 2.00 I want to SUM([Value]), grouped by the [Model] but also […]
should i expect data types in task->export data from ssms? - Hi i recently exported a number of "to be purged resultsets " to .tsv's.     this is a related link  https://www.sqlservercentral.com/forums/topic/is-there-a-reorg-available-in-sql-server . my next step was to see how i'd fare trying to rehydrate to a table with the same cols and data types from one of these tsv's, specifically one with high volume (9 […]
Azure Data Factory
Connecting ADF to take information from sharepoint and from Confluence - Dears, Hope this message finds you well Using Azure Data Factory, Issue 1: I want to connect to Confluence to extract information from confluence pages into HTML format and place them into a folder in my landing zone (Azure datalake). Confluence Cloud REST API via ADF HTTP or REST Connector What do you think is […]
Don't want to connect to the high transactional on-premises SQL Server Database - Dears, Hope this message finds you well We have a on-premises transactional database which is heavily used for transactions. Issue : We are creating a chatbot which will query the database so that users can make questions in natural language and get replies in SQL. This is all done by the AI, But for that, […]
Anything that is NOT about SQL!
Need help in changing my displayname - How do I change my display name, in my edit profile there are only drop down options available. No option available to edit existing displayname. thanks inadvance.
Editorials
Three Times a Day - Comments posted to this topic are about the item Three Times a Day
A Well Deserved Break - Comments posted to this topic are about the item A Well Deserved Break
SQLServerCentral.com Website Issues
Error: There was a problem subscribing. - I am seeing this error when I try to subscribe to a post. Anyone else?
Article Discussions by Author
How to Work with RStudio and SQL Server - Comments posted to this topic are about the item How to Work with RStudio and SQL Server
Why Clone Fails: Discovering the Hardware Beneath Azure SQL MI - Comments posted to this topic are about the item Why Clone Fails: Discovering the Hardware Beneath Azure SQL MI
SQL Server 2022 - Development
Better way to set order of selections/precedence order? - Our application sells products from various distributors. Each buyer has a "precedence order" when it comes to their most to their least favorites distributors. For ex:  BuyerA can have precedence order of (Vendor2 is favorite, Vendor 1 is second choice, Vendor 3 is last choice) assuming that there are only 3 potential distributors. BuyerB can […]
 

 

RSS FeedTwitter

This email has been sent to [email protected]. To be removed from this list, please click here. If you have any problems leaving the list, please contact the [email protected]. This newsletter was sent to you because you signed up at SQLServerCentral.com.
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved.
[email protected]

 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -