Sr. Content Developer at Microsoft, working remotely in PA, TechBash conference organizer, former Microsoft MVP, Husband, Dad and Geek.
154098 stories
·
33 followers

Introducing sp_QuickieCache: 80/20 Plan Cache Analysis to Find Your Worst SQL Server Queries

1 Share

Introducing sp_QuickieCache: 80/20 Plan Cache Analysis to Find Your Worst SQL Server Queries


Chapters

  • *00:00:00* – Introduction
  • *00:00:30* – Recent Video About 80-20 Analysis
  • *00:01:00* – New Store Procedure for QueryStore
  • *00:01:30* – Useful Links in Description
  • *00:02:06* – Free Resources and Services
  • *00:02:34* – SQL Server Performance Monitoring Tool
  • *00:03:00* – Built-In MCP Tools
  • *00:03:11* – Query Data Protection
  • *00:03:28* – QueryStore Benefits
  • *00:03:40* – Surprise Pre-Conference
  • *00:04:00* – Upcoming Conferences
  • *00:04:58* – SPQuickieCache Store Procedure
  • *00:05:03* – SPQuickieCache Overview
  • *00:05:20* – High-Impact Parameter Analysis
  • *00:05:31* – Query Scoring and Tuning
  • *00:06:45* – Detailed Query Information
  • *00:07:17* – Plan Cache Insights
  • *00:08:09* – SPBlitzCash Database Checks
  • *00:08:26* – Find Single Use Plans
  • *00:09:05* – Find Duplicate Plans
  • *00:09:37* – Query Store Alternatives
  • *00:10:17* – Thank You and Future Videos

Full Transcript

Erik Darling here with Darling Data. And in today’s video, we’re going to talk about, let’s see, did it happen right? It happened, right? I had to take, if you pay attention to the goings on of Erik Darling and his Darling Data life, there was a video recently about adding sort of 80-20 query analysis into SPQuickieStore, which was very, which continues to be a very, useful thing for me. Uh, it’s in the latest release of the, my, my SQL Server, uh, performance troubleshooting scripts, uh, doesn’t have a snappy name, no first responder kit, but, you know, someday, someday I’ll figure that out. Um, but, I was working with someone recently who, uh, was, was philosophically opposed to QueryStore. Much, you know, there are various reasons why, some, some, some, you know, uh, some right, some wrong, but, you know, I just refused to turn it on, and we needed a way to look at QueryStore. And I wanted to use a similar way, so, uh, I ported the find high impact section of code over to a new store procedure, and I also added a couple bells and whistles to it. So, uh, we will, we will look at that, and we will also, uh, actually, no, we’re, we’re only going to do that. That’s, that’s all we’re doing today. We don’t have, we can possibly cram another iota of interesting things into this.
Uh, down in the video description, you will find all sorts of helpful links for, uh, our lives, to make our lives intertwine wonderfully financially together. Uh, you can hire me for consulting, you can buy my training, and for as few as $4 a month, you can, you can, you can feed a starving consultant, um, uh, some tiny fraction of a New York cappuccino or espresso. Uh, for free, though, you can ask me office hours questions. Maybe you can ask me how to draw other things in SQL Server Management Studio, and we can try that. Uh, and of course, if, if your enjoyment and appreciation of me, uh, is not, is not measurable in money, uh, you can always like, subscribe, and of course, uh, tell a friend about, uh, whatever it is you find useful here.
Or, I don’t know. Maybe you just like Adidas t-shirts. Right? Could go either way. Uh, for free! Also, you can download my SQL Server performance monitoring tool. Um, no, no, no weird telemetry or email sign-up required. I don’t, I won’t spam you with crap. Uh, it’s just all the stuff that I care about monitoring, uh, performance-wise in a SQL Server, uh, collected and, and made into beautiful charts and graphs with all sorts of very user-friendly ways of, uh, looking at that data and getting root cause analysis of your SQL Server performance issues. Uh, there is, uh, also a built-in set of MCP tools that you can have your robot friends talk to about your performance data and only your performance data.
And it’s a magnificent thing in the world, right? Because you, you don’t have to let them loose into your, into your production SQL Server to, like, start running all sorts of crazy queries. They just touch the performance data that’s already been collected, and that’s much easier for them to understand, too, right? Because we, we retain all the important details. We don’t lose them, right? When various things go away and age out of SQL Server, we collect it all over time. It’s beautiful. It’s a wonderful thing, and it’s free.
I have a surprise pre-con. Um, I don’t know, I guess someone else’s airline tickets got canceled or something. I don’t know. Maybe they, sick, maybe their parakeet died. I don’t know. Uh, but I will be at Day of Data Jacksonville, Florida, May 1st and 2nd. Boy, howdy. Look at that. Um, and I will be doing my advanced T-SQL pre-con shenanigans there, so, uh, if you want to come see me in Florida, it’s been a long time since I’ve been to Florida.
Apparently, I’ll be there. Alright. Uh, other places in the world I’ll be. Golly and gosh, look at all these wonderful people who decided to let me, like, be in public, in front of people, and, uh, not stuff a sock in my mouth yet. Uh, I’ll be at Pass on Tour, Chicago, uh, May 7th and 8th. I will be at SQL Day, Poland, May 11th and 13th. Uh, I will be at Data Saturday, Croatia, June 12th and 13th. And then I will be at, in Pass Summit, Seattle, uh, November 9th and 11th. Ah, man, Pass Summit, Seattle. There we go. I am, I am not even drinking today yet.
That’s the funny part. Alright. Cool. With that out of the way, let’s look at this new store procedure. Uh, I think I have to go to Management Studio. Yeah, I remember what that looks like. Alright. Cool. So, uh, this is, this is it. SPQuickieCache. Pay no attention to the terrible red squiggly underlines.
Um, and this is what you get back. So, if, if you have been using, um, uh, SPQuickieStore and you’re on a relatively new version of it, you will find that there is a high-impact parameter, which gives you a similar set of stuff. Uh, the whole idea here is to find queries that hurt you across a variety of metrics and sort of score them and, uh, present them to you in an order in which you should tune them.
Right? Because that is a, a wise and wisdomful thing to do. So, uh, this is sort of what you get back. Um, let’s zoom in on the results here. Up at the top, we tell you how many plan cache entries and all this other stuff we captured. And, um, you know, it was good stuff, right? Like, good information up here. Uh, and then down in this section, this is where your 80-20 queries live. Um, I have taken it upon myself to do some neat things in here, like tie statements back to the procedure that they live in. Uh, I think if we scroll down a little bit further, there’s another one, but I might be wrong because I might’ve run some stuff between now and then. Yeah, it’s not in there, but, um, you know, like for like this line, you get like just create procedure. And there are some things that we don’t get back at the procedure level that we get back at the query level. So, uh, there’s all sorts of neat stuff in there, right?
Like, uh, let’s see up here, we have create procedure, any word, right? And this is like, misses the query hash, but down here we see like the queries from that store procedure, right? So that, that’s, that’s, that’s how it works. But then over to the right, we have some other things too. Uh, we have this impact score and we have, uh, the areas in which queries returned, uh, high signals, right? Uh, so, um, this one up here up at the very top spilled a lot, right? That was how many times it spilled. And if we look over here, uh, we’ll even see, uh, the total spills and the stuff like that. So, and, you know, max spills and all these other things. So we get some, some high level information back about like how much damage this thing is actually doing. So we can, we can make smart choices. Um, down here, uh, there is some information about the plan cash, right? So, um, like, like severe plan duplication and single use plan bloating, plan cash stability, right? And single use plans and all these other neat things at the database level. Um, I also added some of these database, well, I was working on this.
I added some of these database level checks as well to SP blitz cash. So if you are an SP blitz cash fan or aficionado or whatever, um, you’ll, uh, I think at some point when Brent does another release, you will see, uh, the database level breakdown of, um, of, uh, duplicate plans and single use plans. So if there’s like a single database on your server, that’s responsible for all this, it used to just be at the server level, right? And just be like, there’s a lot of plans for this query, but now it’s like for the database, like, look how bad this is. Now, just like all my other store procedures, uh, there is a help parameter where you can see how everything is set up and gets used and that it’s MIT licensed and that, you know, we, um, you know, give this stuff away for free. I give this stuff away for free. Uh, but the important part here is that it lists out all the parameters. And if you look in here, there are a couple of neat little doodads, like find single use plans and find duplicate plans because a lot of the times, Oh, we don’t need you. Uh, you’re, you’re a quickie store. You, how’d you sneak in there? Um, so a lot of the times when, you know, you see alerts like, Oh, there are a lot of single use plans or, Oh, there are a lot of duplicate plans. Uh, you’re like, well, where are they? How do I, you’re going to make me go find those? How do I, how do I do it? I’m hope lost and hope hopeless and helpless. How can I possibly be a more self-sufficient person in the world? Don’t worry. You can be, you don’t have to be, you can be codependent on me. So if we run this query, uh, or rather run SP quickie cash with find single use plans, I will return to you single use execution plans, and I will give you a command to get rid of them. Right? So that’s, that’s cool there. And then there’s also find duplicate plans, and this will give you the top 10, uh, most duplicated plans in your cache. Right now, it appears this TPC database is really, uh, just a nightmare mess of, of things, right? Look at this 1600 plans and 1600 executions, right? And the, the story doesn’t look good there. Right. But, um, you know, this will help you maybe find queries that need parameterizing, um, or maybe it will help you turn on force parameterization for an entire database to avoid the problem. But either way, uh, you get some useful information back there. Uh, this store procedure, just like all my other store procedures are available in my GitHub repo. That’s at code.erikdarling.com. Uh, again, type that out for you. So you can be even more codependent on me. You can be codependent on my code code.erikdarling.com. You can get this here. Uh, you can start using it. You don’t have to turn query store on for it. Um, uh, so that’s, that’s cool too. Anyway, thank you for watching. I hope you enjoyed yourselves. I hope you learned something and I will see you over in tomorrow’s video where we will do, I don’t know, something stuff. We’ll figure it out.
I do all this stuff at the last minute anyway. All right. Thank you for watching.

Going Further


If this is the kind of SQL Server stuff you love learning about, you’ll love my training. Blog readers get 25% off the Everything Bundle — over 100 hours of performance tuning content. Need hands-on help? I offer consulting engagements from targeted investigations to ongoing retainers. Want a quick sanity check before committing to a full engagement? Schedule a call — no commitment required.

The post Introducing sp_QuickieCache: 80/20 Plan Cache Analysis to Find Your Worst SQL Server Queries appeared first on Darling Data.

Read the whole story
alvinashcraft
just a second ago
reply
Pennsylvania, USA
Share this story
Delete

Launching the SSMS Extension Gallery

1 Share

I’m excited to announce the launch of the SSMS Extension Gallery:

👉 Find it here

This new page gives SQL Server developers and DBAs a quick overview of tools that can improve day-to-day work in SQL Server Management Studio 22.

The goal with this launch is simple: make it easier to discover both free and commercial SSMS extensions in one place.

I got inspired to build this by the blog post from Brent Ozar here.

If you build or maintain an SSMS 22 extension and want it included, please open an issue or pull request.

Read the whole story
alvinashcraft
just a second ago
reply
Pennsylvania, USA
Share this story
Delete

Agentic software development hypothesis

1 Share

Agentic software development hypothesis

This is the quality content you come here for, right?

Agentic Software Development Hypothesis:

  • Weak form: Any coding task for which a complete specification is available will become trivial.
  • Strong form: Any coding task for which a deterministic oracle is available will become trivial.

First objection: Few meaningful tasks have a complete specification. Second objection: Most oracles aren’t deterministic.

  • Strongest form: Any coding task for which a non-adversarial (pythic?) oracle exists will become trivial.
Read the whole story
alvinashcraft
14 seconds ago
reply
Pennsylvania, USA
Share this story
Delete

Maker Faire Brussels: A Fabrication Engine In The EU Capital

1 Share
Maker Faire Brussels: A Fabrication Engine In The EU Capital

On May 23–24, 2026, Maker Faire Brussels roars back into CanalCity in Anderlecht for a multi-faceted celebration of creativity, DIY culture, local manufacturing, and hands-on tech that’s as unique and complex as this crossroads city itself. Come for the science, stay for the workshop playground, get inspired by creatives and creators reinventing the future as […]

The post Maker Faire Brussels: A Fabrication Engine In The EU Capital appeared first on Make: DIY Projects and Ideas for Makers.

Read the whole story
alvinashcraft
30 seconds ago
reply
Pennsylvania, USA
Share this story
Delete

My experience at PyCon US 2026

1 Share

I'm writing this post on the flight back from PyCon US 2026 in Long Beach, California. It was my second time attending PyCon, and it was a fantastic conference - a cornocopia of Python knowledge, but more importantly, a coming-together of developers across the Python ecosystem.

I'll recap my PyCon US 2026 experience in this post, both what I contributed and what thousands of others contributed. First, a big old disclaimer: part of my job as a developer advocate at Microsoft is to attend conferences like PyCon, so I was able to expense my travel and spend my work days on my PyCon contributions. But that's also why I picked my job, as it gives me the excuse to do things that I'd want to do anyway, like attending the largest gathering of Python devs in the world.

My tutorial

Since I've been spending so much time on Model Context Protocol (MCP) in the past year, I submitted an idea to the PyCon CFP to run a tutorial walking developers through the process of building their first MCP server. I was thrilled that the tutorial was accepted, but nervous since I'd never delivered a tutorial at a PyCon before. Fortunately, I was able to test it out with the SF Python meetup group a few days before, and their feedback helped me streamline the tutorial experience immensely.

I delivered the tutorial at PyCon to a packed room: 84 people, all seats filled, bright and early at 9AM on Wednesday morning, the first slot of the week-long conference.

We started off the tutorial with an icebreaker, which included attendees inventing their own meaning for "MCP". Of course, my not-so-secret goal was for them to get to know their neighbor, to encourage pair debugging during the exercises.

I alternated between slides and exercises in the 3.5 hours tutorial, trying to give attendees enough background knowledge while also giving them the time to get hands-on. We started off with attendees using MCP servers, via both coding agents (Copilot/Claude Code) and agent frameworks (Pydantic AI, Langchain, Agent-framework). Then attendees moved on to building MCP servers, using FastMCP and the open-source KeyCloak identity server.

Overall, the tutorial went really well with minimal technical issues - and hey, the WiFi even worked, which is my #1 need in a conference venue. Thank you to my colleagues Gwen and Sarah for TAing, and for all the attendees for being so eager to learn! I'll definitely submit a tutorial proposal for next year's PyCon.

Education Summit

Kelly Paredes, from the Teaching Python podcast, organizes a day-long Education Summit each year before the main PyCon begins. The mini conference brings together educators, researchers, students, and EdTech software developers, to talk about the intersection of Python and education.

This year, I gave two sessions, starting with a talk called "Your slides but faster: Building an AI-powered presentation workflow". I walked through my process of using Reveal.JS alongside GitHub Copilot to make presentations, and shared the prompts and skills I use to collaborate with the coding agent.

At the end of the day, I led a mini tutorial on the same topic, so that attendees could experience the process themselves.

My colleague Gwen gave a talk called "Big Lessons from Small Models: Teaching Python AI with SLMs", based on our attempts to add SLM support to every code sample we use in livestream series. Gwen showed Ollama setup code, gave recommendations for which SLMs to use, and highlighted a teaching angle of SLMs: students have to get creative to work around the constraints of SLMs, and it forces them to understand SLMs more deeply.


EduSummit was filled with many other great talks. My favorite was from the always entertaining Reuven Lerner on "Vibe teaching: Python training in the age of AI" , where he shared his realization that he couldn't ignore agentic coding in his Python training courses anymore, as his customers are insisting on its inclusion. He showed ways he changed his existing courses and shared prototypes for new courses. To make sure he really understands the benefits and pitfalls of agentic coding, he is vibe-coding an app that helps students practice what they've learnt and receive LLM-based feedback.

Booth

As a sponsor of PyCon, Microsoft had a booth from Thursday evening through Saturday of the event. I was at the booth for most of the hours it was open, both because we were understaffed and hey, I just like boothing! It's a great opportunity to chat with developers, and many of the folks who stopped by were attendees of my earlier sessions. We talked about things like MCP, agents, models, GitHub Copilot, and agents skills - anything that was on their mind or projecting from my laptop. It was also a chance to connect with Microsoft colleagues that I rarely see IRL, since we mostly work remotely.

Talks

I managed to see a good number of talks this year, especially from my colleagues and folks I know from the community. They were all fantastic. A few highlights

Open Spaces

PyCon lets attendees propose "open spaces" based on topics we suggest, so that we can come together on topics that aren't on the schedule, typically for a group discussion. Occasionally open spaces are used for not-so-technical topics, like ice cream selfies and juggling. At his great suggestion, Evan Kohilas and I organized an open space for improv! We gathered together in the lobby and played newbie-friendly improv games with whoever wanted to come. It was super fun - so fun that we did it again that night in the hotel lobby.

Hallway Track

We often say that the best part of the conference is the "hallway track": the spontaneous interactions that happen between the sessions in the halls. I talked with developers I've met at previous conferences, developers I'd only ever met online, and developers that I've never talked with before. As a whole, the Python community is a very welcoming bunch, and everyone seemed eager to make new connections. And take new selfies!

PyLadies Auction

Every year, the Pyladies organization organizes a charity auction to help raise funds for Pyladies chapters and their annual conference. The PyCon community donates all sorts of fun items for the auction, like life-size cut-outs of Guido, Python-themed art, autographed books, 3-d printed snakes. Last year, I won an amazing pair of homemade earrings, and I kept up the earrings tradition this year with a pair of snake earrings. The auction is quite fun, and a good excuse to donate to PyLadies while getting new jewelry out of the deal. By the end of the night, we'd collectively raised $60,000 for PyLadies!

Sprints

The last two days of the PyCon conference are dedicated to OSS sprints. This is when maintainers of Python packages sit at a table, welcome new contributors, and guide them towards their first contributions to the project. This was my first year staying for sprints, and to keep my trip shorter, I only stayed for a half day. I sat down at the Pallets table, since I've contributed to Flask-SQLAlchemy and Flask-Admin in the past, and tried to both help the newer folks and make a few fixes myself (to the click and website repos). My changes were only documentation improvements, but that's often a good place to start, as it still introduces you to the fork-PR-merge flow used by each project.

Overall impression

PyCon US 2026 was an experience. It offers so many ways to contribute and participate, and I feel like I only talked about half of it here - I left out the hotel board games, the happy hours in funny venues, the bonding over yummy noms, the random encounters on boardwalks. Thank you so much to the Python community for being so welcoming and to the PyCon organizers for a job well done!

Read the whole story
alvinashcraft
1 minute ago
reply
Pennsylvania, USA
Share this story
Delete

Three more static code analysis sensors

1 Share

Birgitta Böckeler adds discussion of three more sensors for static code analysis, focusing on checking and enforcing better modularity. Computational sensors for dependency checks were good at enforcing rules, but the rules were limited. Building a computational sensor for coupling data proved lackluster. Prompting an inferential sensor to review modularity was more effective.

more…

Read the whole story
alvinashcraft
1 minute ago
reply
Pennsylvania, USA
Share this story
Delete
Next Page of Stories