Blog

  • Automatic Sample Sizes for Statistics Updates

    I mentioned in my previous post about manually updating statistics that you can specify whether they’re updated using a full scan, or you can specify an amount of data to sample, either a percentage of the table size, or a fixed number of rows. You can also choose not to specify this, and SQL Server Read more

  • How to be a bad interviewer

    In the monthly SQL blogging party that is T-SQL Tuesday (brainchild of Adam Machanic), Kendra Little has invited us this month to talk about interview patterns/anti-patterns. https://littlekendra.com/2017/08/01/tsql-tuesday-93-interviewing-patterns-anti-patterns/?utm_campaign=twitter&utm_medium=twitter&utm_source=twitter Before my current role which I’ve been in for just over 5 years, I spent most of my career as a contractor, performing shorter roles that lasted from Read more

  • Manually updating Statistics

    Even though SQL Server automatically updates statistics in the background for you, you may find there are times when you want to manage updating them yourself. You may have large tables and find that the interval between the automatic updates is too big and is resulting in sub-optimal query plans. You might need timely updates Read more

  • Statistics and the Ascending Key Problem

    I’ve mentioned previously how not having up to date statistics can cause problems in query performance. This post looks at something called the Ascending Key Problem which can badly affect your cardinality estimation in some cases and therefore your execution plans. The Ascending Key Problem relates to the most recently inserted data in your table Read more

  • SQL Server Agent and Daylight Saving time

    There was a bit of chat today on the SQL Community slack about UTC and Daylight Saving Time. It reminded me I have a post in draft somewhere about the complications of dealing with timezones in SQL that I should get around to finishing. It also reminded me of a fact I found in an Read more

  • SQL Puzzle 2: Eight Queens

    This puzzle was first proposed in 1848 by a composer of chess puzzles called Max Bezzel and has since spawned much analysis and many variants. Simply phrased, it goes as follows: “Can you place 8 queen’s on a standard (8×8) chessboard so that no two queen’s threaten each other?” (Just in case, I’ll remind you Read more