Thanks to Paul Randal and his recently published blog post: “The Curious Case of… tracking page compression success rates“, I finally discovered what was the purpose of the column page_compression_success_count from the system function sys.dm_db_index_operational_stats, and how to use it.Read More »Detect Low PAGE Compression Success Rates in all Databases
Every once in a while there comes an opportunity to “upgrade” your abilities with newly acquired knowledge that lets you “step up your game” and possibly add some “wow factor” to your work, leaving your peers awe-struck by your amazing new “magic trick”.
As a SQL Server consultant, one such opportunity that I had in my line of work, is when I learned about “Hypothetical Indexes” and how to use them.Read More »Performance Tuning Like a Pro – with Hypothetical Indexes
Back in April 2020, I created an open-source project called “SQL Server Page Allocation Reports“. It consisted of a set of SQL queries and some Power BI reports that can be used for visualizing the size and locations of your data and transaction log pages.
Well, recently I also added SSMS Custom Reports into the mix. So, it’s time to revisit this project and see what’s new!Read More »It is 10 PM, do you know where your pages are?
This month’s #tsql2sday is hosted by John McCormack who asks us to share some useful snippets of code that can help us in our everyday jobs.
Well, honestly, this is more or less what my blog is mostly about anyway: sharing insights, scripts, and code snippets that I found to be helpful in my day-to-day job as a SQL Server consultant.Read More »T-SQL Tuesday #143 – Short Powershell code to move DB files in AlwaysOn
Which drawbacks are there to using the built-in sp_MSforeachdb stored procedure? What other alternatives are out there? Is there a simpler solution? Find out all this and more in this short post.Read More »The Simplest Alternative to sp_MSforeachdb
“Extended properties allow you to add custom properties to database objects”, so says the official Microsoft documentation. However, very few DBAs make use of them, if at all. This is actually a good thing, because indeed the scenarios in which this feature could be useful are relatively few and rare.
On the other hand, I also see DBAs essentially jumping through hoops to implement something, which could in fact very easily be implemented using Extended Properties.
What are these peculiar use cases? Let’s look at a few examples.Read More »Finding a use for Extended Properties in SQL Server
Do you find yourself facing performance problems and long lock chains caused by very frequent INSERT, UPDATE, or DELETE statements being executed on a table? Check out this neat trick that could help you out and make all the difference in the world.Read More »The Asynchronous Ledger Trick for Fast SQL Server Insert, Update and Delete Processes
In one of my previous posts, Fun with DATETIME Arithmetics, I introduced a way to use “math” to manipulate
datetime values for effectively generating, calculating, and displaying intervals (i.e. difference between two
datetime values). These mostly work with the addition and subtraction operators (+, -).
In one of the paragraphs, I mentioned multiplication and division, and posed the question about why anyone would ever need to do this.Read More »Even more fun with DATETIME arithmetics!
If you know me, you already know that I’m a huge fan of automation. Therefore, it’s natural to assume that I would dabble in Powershell at least once or twice or a few dozen, as a method to implement useful automations. After all, automation is pretty much the whole essence of Powershell in the first place.
As I used Powershell scripts more and more, I learned that there are a few things that are important to have whenever you use such scripts as part of automation (by “automation” I mean any sort of operation done “unattended”, i.e. without direct human interaction in real-time).Read More »One handy Powershell script template to rule them all
This month’s #tsql2sday is hosted by @AndyLeonard, who asks us to write about “software changes”. Well, I think it’s time to be changing sp_help_revlogin. What do you think?