Some people love ‘em, some people hate ‘em. But, one thing I have found to be nearly universal is that most people misunderstand how Views are used in SQL Server.
A View is merely a pre-defined query that can be treated in many ways as a table. This… Read more
Have you ever written a query that just seems to take forever? You have looked it over time and time again, and it seems to be perfect! It’s straightforward, has an appropriate index, and still takes 5, 10, 15 seconds… or even minutes?.
A common cause in this scenario is… Read more
Many people, once they start getting comfortable writing SQL, begin asking the same questions. One such common question is “Does the order I put stuff in the WHERE clause make a difference?” This question usually means different things to different people, so let’s dig in a bit.
There are often… Read more
A pervasive oversight in database indexing by newer database users is relying solely on indexes used for joining tables together (i.e. foreign key indexes.) For example, say you have a Puppies table and a Kid table. Most likely, there is a Kid_ID column in the Puppies table pointing back to… Read more
The following queries look extremely innocent. However, they are all application killers once the target table grows to more than a couple thousand rows:
Select Count(*) From Person_Data Where Upper(Name_Last) = ‘SMITH’
Select Avg(Collar_Size) From Person_Data Where dbo.MyFunc(Person_Data_ID) > 500
For each of these statements, a table scan will be… Read more
One of the first roadblocks many developers run into when using SQL Server for the first time is firing off a query that simply selects data, and having the query never return a result. After spending several minutes of their precious life-force watching nothing happen, they get aggravated, cancel the… Read more
Time and time again I have run into the scenario where a developer who is moving into using databases is not solid on what an index is or how to correctly utilize them. While this is well-worn territory for the DBAs in the crowd, it bears taking some time for… Read more
Here’s a big statement
WHEN WRITING DATABASE QUERIES, 95% OF THE TIME THE BOTTLENECK IS IN THE I/O, not the CPU, and not the memory. Often, when queries run slowly, the newer database developer will suspect that the hardware is insufficient. While beefier hardware can make a dent, the well… Read more
In my real-life I play guitar. Being an analytical sort-of-fella I found myself inhaling all the books, videos, advice, etc. that I could muster. One of the best pieces of advice went something like this (and it applies to SQL as well):
“A guitar is only a piece of wood… Read more
I have posted this before elsewhere. However, due to the frequency in which I come across this, I feel it’s worth reiterating…
This unfortunate situation arises all too frequently, and there is a relatively simple solution to it.
Often, everything performs well in your development/test environment because you have relatively… Read more
To kick off this blog, I am going to start with a topic that is hot on the mind of most developers who begin using databases in a serious way, and that is performance!
As developers begin using databases or scale up into applications that need to track a lot… Read more
Bear with me as I wax philosophical for two sentences. Our societies are becoming more polarized with each passing day. We see this in spirituality, politics, family life, and most other aspects of our lives. As IT professionals, our careers are impacted by this polarization. There are pressures for us… Read more