OTOlabs

Posts tagged with "sql server"

An update of my SQL Server “Bad Habits” series

badhabit

Last October, I started a series of blog posts over on sqlblog.com that highlighted some bad practices I observe from time to time.  Earlier this year, I felt motivated to pick the series up again.

Read Full Post No Comments

Mixing OLTP and reporting using indexed views

I’m not a big fan of denormalizing, nor of repeating redundant redundant information in a database when those facts can already be derived from other information.  A classic example of the latter is when I see questions on newsgroups, forums or StackOverflow that ask how they can update a table’s rank column to reflect the current rank based on some other criteria in the table.  The problem with this is that you have to run the update every time any DML operation touches any row in the table, and if you can calculate that rank in an UPDATE query, you can also calculate that rank in a SELECT query, so why not just figure it out in real time?  An example of the former is when we want to maintain a second table with aggregates from another table.  This is where I want to spend my time today.

In reality, many of us deal with OLTP systems that must also serve as the reporting source, so it’s not always feasible to calculate aggregates in real time against a constantly moving target.  In several of these scenarios I’ve used indexed views, where we have tables that are inserted often, read often for statistics, but rarely or never updated… sure, you pay a little hit up front on the insert, but the benefit achieved during real-time reporting was worth it.  Let me give you an idea of what I was dealing with initially, and how I have fixed it over time to perform even better.

One of our systems is…

Read Full Post Read Comments(1)

Helping people kick bad SQL Server habitsEarlier this week, I started a series of blog posts aimed at helping people kick their bad SQL Server habits.

Bad Habits in T-SQL

Read Full Post Read Comments(4)

New whitepaper on Resource Governor available

sql2008rgwp

Read Full Post No Comments

The cost of reinventing the wheelDevelopers often resort to solving a problem through brute force, discounting existing solutions due to cost, lack of feature set, or simply not knowing they exist. What can we learn from this?

wheel_sm

Read Full Post Read Comments(3)

Using a Mac in a Windows worldIf you've read any of my material on sqlblog.com or follow me on twitter, you have probably already painted a clear picture that I'm a Windows-based database guy; more recently, though, I have been branded a crazy Apple fanboy... and deservedly so. Here's my story...

mac_pc

Read Full Post Read Comments(19)