Premium Database on Azure

Azure
One of the things that can make Windows Azure SQL Databases (WASD) attractive is the fact that they run inside of a managed environment. But, that does mean that you're sharing resources with other databases. That's not necessarily a bad thing, but if people are extremely worried about performance, yet, still want to take advantage of all the cool stuff in WASD, there is a way to do this; Premium Databases. I requested access to the early access program and was able to get it. You can request it by clicking on this link and scrolling down to Premium Database. Once you get access you should see this in your list of servers: To create a Premium Database you just create a  database any way you would normally (T-SQL through…
Read More

PASS Votes and So Should You

PASS
To put it bluntly, you need to go cast a vote for Allen Kinsel for the PASS Board. In his own words, here's why Allen is running. Why am I supporting Allen? First, he's a friend. But ignore that. This isn't, or at least shouldn't be, a popularity contest. It's about getting what you want, what you need, out of the PASS organization. I absolutely believe that Allen has the best interests of this organization at heart. He wants to make a difference for the better. More than that, I've seen him working as a volunteer within the organization where he does make a difference, does make things better. He brings passion to the job. If you've ever volunteered to help run any kind of organization, you'll know that one…
Read More

Web Design & Azure

Azure
I've listened to tons of programmers and DBAs complain about the look of Windows Azure. But, I'm friends with several design people, work with some pretty darned good designers at Red Gate, and I live in sin with a graphic artist (AKA: Mrs. Scary). While the developers and DBAs complain, lots of the designers seem pretty happy with it. Microsoft has a pretty serious team working on it. You can see an interview with them that tells you a little bit about how they did it. I thought it was interesting. And don't forget, that little contest to win a car ends in just over a week. This is almost your last chance to connect your MSDN account to a zero-cost Azure account and enter for a chance. Or not.…
Read More

SQL Lighthouse

Azure, Redgate Software
Red Gate is constantly experimenting with technology. Because of a long history working within the Microsoft space, a lot of the new experimentation is in and around Azure. One new venture that could be online soon is SQL Lighthouse. It's a mechanism for dealing with changing structures in an unrestricted Windows Azure SQL Database where you have multiple developers making changes. Potentially, this is pretty interesting. Please follow the link, check it out, and sign up to be alerted when the program becomes available. Many people are just getting started with Azure, especially wrapping their heads around the concepts of using a Platform as a Service rather than having infrastructure, local, virtual, or on the cloud. If this is you, and you have an MSDN license, you can get that…
Read More

Finding Ad Hoc Queries with Query Hash

SQL Server, T-SQL
I was presenting a session on how to read execution plans when I received a question: Do you have a specific example of how you can use the query hash to identify similar query plans. I do, but I couldn't show it right then, so the person asking requested this blog post. If you're dealing with lots of application generated, dynamic or ad hoc T-SQL queries, then attempting to determine tuning opportunities, missing indexes, incorrect structures, etc., becomes much more difficult because you don't have a single place to go to see what's happening. Each ad hoc query looks different... or do they. Introduced in SQL Server 2008 and available in the standard Dynamic Management Objects (DMO), we have a mechanism to identify ad hoc queries that are similar in…
Read More

Great Idea: Tribal SQL

Misc
Writing books, even just a chapter, is not easy. Yet, people are desperate to do it for some reason. But, it's actually hard to break into writing (not that hard, I did it after all). So, when you get the chance to work on a book, if you're crazy enough to think you want to, jump on the opportunity. My good friend, and co-author of SQL Server MVP Deep Dives Volume 2, Jenn McCown (b|t) had an idea. Instead of gathering up a bunch of the usual suspects, what if you gave people who have never published anything a shot at writing a chapter. Yeah, insane, right? But then again, every author you know, at one point, wasn't published. Someone gave them a chance. Jenn is just that kind of…
Read More

Why the Lazy Spool Is Bad

SQL Server, T-SQL
First thing, there are no bad operators, just bad parents, uh, I mean query writers, or database designers, or ORM tools. Why do I say this? Because all the operators within a query execution plan serve a purpose. They are there to fulfill a task. Depending on where and when you see them, they're doing exactly what you ask of them. The issues come up because you're asking them to do a task that they may not be well suited for. This comes from inappropriate structures and inappropriate code. Lazy spools are not really bad (that was just link bait). In fact, depending on the query, what's being done, how you're retrieving data, what data is being retrieved, the lazy spool is actually awesome. But, it's good to know what…
Read More

Are Foreign Keys Better Than Indexes?

SQL Server, T-SQL
When I first saw this question I thought to myself, "Self. Don't you think that's comparing apples to hammers? Yes, Self, I'm pretty sure it is. Good, I thought so too, self. Yeah, me too." After rebooting because of the runaway iterations on that thought, I had another, "Well... hold on there self. Both types of objects, while pretty different, are taken into account by the query optimizer." I then had to admit to myself that I had a point. So the question remains, are foreign keys better than indexes? As my first self said, these are different objects and they fulfill different purposes within SQL Server. My second self wants to point out that when you're dealing with functional objects within SQL Server, it's a bad habit to start…
Read More

Microsoft Expands Data Centers… Again

Azure
Didn't they just do this in the spring? Word is out that they're expanding even more data centers. The cynical take would be that it's really all about the expanded need for data because of XBox One. But I doubt that explains it all. What's happening is that Azure is finally taking off. Note, I didn't say that Azure SQL Databases are taking off. I'm not sure they are. I think it's a combination of the web sites and the virtual machines. I've a feeling that Microsoft's investment is actually going to pay off. Question for you. Have you invested in Azure too? If not, time to get started. I've posted about it multiple times, so I won't insult you with a bunch of links. Just one, connect your existing…
Read More

Execution Plan Cost Estimates

SQL Server, T-SQL
It's been emphasized over and over that the costs of operations within an execution plan, and the estimated costs of the plan themselves are, in fact, estimates. But it goes further than that. The estimated values are based on statistics, or the lack thereof. Statistics themselves are also estimates. This means that the costs you're seeing are extrapolations based on extrapolations. So, you should just ignore those values and move on, right? Wrong. In order to understand how the optimizer is choosing to put together an execution plan for your query so that you can use that understanding to then make intelligent choices as to modifying the query or the structure of your database, you must use the values you have at hand. However, you must also understand where and…
Read More