Automating Automatic Indexing in Azure SQL Database

Azure
I've been in love with the concept of a database as a service ever since I first laid eyes on Azure SQL Database. It just makes sense to me. Take away the mechanics of server management and database management. Focus on the guts of your database. Backups, consistency checks, these easily automated aspects can just be taken care of. Same thing goes with some, not all, but some, index management. Azure SQL Database can manage your indexes for you. I call it weaponizing Query Store. Anyway, I needed a way to automate this for the book I'm writing. I couldn't find any good examples online, so I built my own. Queries in Need of Automatic Indexing Because I want this to be as simple and repeatable as possible, I'm using…
Read More

YouTube Channel Update: 27 April 2018

Professional Development
Despite a hiccup recently on Twitter where I managed to spam all my followers with links to my YouTube videos (so sorry about that), I am still posting videos. Please subscribe to the channel. Video Lists I created video lists. Here they are, in no particular order: SQL Server and Microsoft Data Platform GDPR and How It Relates to Your Data SQL Server Query Performance Tuning Redgate Software Videos DevOps and Databases I hope it helps to have them grouped up. Videos Here are the videos I've posted over the last few weeks. First, too many people take a "poke it and see what happens" approach to query tuning. I try to talk to that issue here: [embedyt] https://www.youtube.com/watch?v=gHxOrPEyPb8[/embedyt] Want to know where I go to learn about the GDPR?…
Read More

Presentation Tools

Professional Development
Let's face it, the core of a presentation is you. Your knowledge and your ability to share that knowledge through whatever means you choose, slides, demos, sock puppets, whatever, is the primary tools you need to hone. Know what you know and be ready to acknowledge what you don't. Put out the information as only you can. That's the key to presenting. But... A few things can help reduce your stress and make your life easier. Let's talk about them. My Presentation Tools Whether your travel to the event or not, chances are good, that whatever code camp, SQLSaturday, or awesome event where you are presenting is not your home or office. This means, you can't know what their set up is. Because of this, road warrior or not, if…
Read More

Execution Plan Shortcoming in Extended Events

SQL Server, SQL Server 2016, SQL Server 2017
I use Extended Events almost exclusively for capturing query metrics. They are the most consistent and lowest cost mechanism for getting the time and resources used by a query. They can be filtered, combined with other events, they're just marvelous... until you capture an execution plan. Execution Plans in Extended Events Don't get me wrong. Capturing execution plans with Extended Events is the way to go if you're attempting to automate the process of capturing plans on specific queries on an active system. It's step two that bugs me. So, we capture the plan. Here's an example script. Captures all the various plans and the batch, puts 'em together using causality tracking: CREATE EVENT SESSION ExecutionPlansOnAdventureWorks2014 ON SERVER ADD EVENT sqlserver.query_post_compilation_showplan (WHERE ( sqlserver.database_name = N'AdventureWorks2014')), ADD EVENT sqlserver.query_post_execution_showplan (WHERE…
Read More

Privacy and Protection, By Design

Redgate Software
With all the noise about the upcoming enforcement of GDPR, I know that people are starting to focus more on privacy and protection. Add in all the other news about data breaches and data leaks and suddenly, privacy and protection isn't just a business concern, it's personal. Where do you go if you want to learn more? How about the SQL Privacy Summit? SQL Privacy Summit Redgate is hosting the first SQL Privacy Summit on May 18th in London, brought to you by the producers of SQL in the City. Yes, lots of information on the GDPR and compliance will be available. However, we're going way beyond that. The reason it's called the Privacy Summit and not just "The GDPR Summit" is because we're talking about more than compliance. We…
Read More

GDPR, Database Backups, and the Right to be Forgotten

DevOps
I've said it before, but it bears repeating, there is no cause for any kind of panic when it comes to the GDPR. None. There are however, a number of concerns. One of those concerns is, well, concerning. How does the right to be forgotten within the GDPR impact database backups? Let's discuss what we know. The Right To Erasure Each of the articles within the GDPR lays out a topic. Article 17 is pretty darned clear about the topic: Right to erasure ('right to be forgotten') Basically, the individuals, also known as the data subject, also known as natural persons, in short, people, can request that you remove their data from your system. The first sentence lays out the gist of the idea quite well: The data subject shall…
Read More

Buggy Whips 2.0

DevOps, Professional Development
I recently found myself rereading a very old blog post of mine, from the very beginning of this blog, discussing Buggy Whips. I'll save you the long read, I was learning new tech, it made me second guess my working assumptions, I was curious if I was manufacturing a buggy whip while watching an automobile drive by. 2008 to 2018 Well, I'm still here. In fact, Feature Driven Development has disappeared from the lexicon and the project that it was introduced to took years longer than anticipated, performed horribly, and had to have a major redesign and rework to be fundamentally functional (all after I left the old organization). So, my fears that database design was a thing of the past were just that, fears... right? Yes and no. Here…
Read More

YouTube Channel Update: March 30, 2018

Professional Development
Hey everyone! Here's the latest stuff on my new YouTube Channel. Please let me know if these videos are helpful. Also, if you have requests for videos on a particular topic, even a video of a blog post I did here, let me know. I take requests and I'm more than happy to help. I've been talking a lot about the GDPR. I released three videos on this topic this week alone: [embedyt] https://www.youtube.com/watch?v=FSbrhv1Fuh4[/embedyt] [embedyt] https://www.youtube.com/watch?v=YFyS45kvtMY[/embedyt] [embedyt] https://www.youtube.com/watch?v=YLYxflj8O9A[/embedyt] I also released a video on using SQL Prompt to help your team audit their code: [embedyt] https://www.youtube.com/watch?v=4TBHGuhgS4E[/embedyt] Finally, I added a video discussing database mirroring as it relates to Azure SQL Database [embedyt] https://www.youtube.com/watch?v=I26K-FWilXA[/embedyt]
Read More

Query Store and Automated Cleanup

SQL Server 2016, SQL Server 2017
Query Store has mechanisms for automatically cleaning your data. It is possible to cause them to break down. While presenting a session about the Query Store recently, I was asked what happened if you set the size of the Query Store below the amount of data currently in the store. I didn't know the answer, so we tried it. Things got a little weird. Bryan Hundley of Marathon Consulting asked the question, so Bryan, this blog post is for you. Automated Cleanup There are actually two kinds of automated cleanup inside the Query Store. First, you have a time-based cleanup. By default it keeps queries that have been accessed within the last 30 days. Anything older, it tosses. If you have the stale_query_threshold_days (all in sys.database_query_store_options) set to 0, it…
Read More

Query Monitoring and the GDPR

DevOps
I've been reading the General Data Protection Regulation (GDPR) and discussing the ramifications of the beginning of enforcement with lots of people. The implications of it all are fascinating. The real serious issues remain primarily a business problem, with business defined solutions. However, there are technology issues that we need to think about. For example, performance metrics are going to be impacted by the GDPR. Private Data and Monitoring Queries First and foremost, let me say something I've said before. The vast majority of the focus around GDPR has to come from your business. Second, the bulk of your work and focus must be on ensuring core functionality in support of the GDPR. Third, the attack vectors and leaks for GDPR are not going to primarily be around something like…
Read More