Indexed Computed Columns and DBCC CHECKDB

Recently I spoke a couple times about using indices to solve some otherwise unsolvable performance problems, like turning non-searchable arguments into SARG ones. Now it’s time to point out a hidden cost of this solution — incredibly slow database consistency check. Problem Let me illustrate this problem with a sample database I used i.e. at [...]

Indexed Views. Part 1. The Benefits

Indices serve three main purposes: 1. They are used to limit (or minimize) the amount of data being read to execute queries. 2. They can eliminate costly operators (like sort or aggregate) from query execution plans. 3. Finally, they can tremendously improve concurrency. On the other hand, indices aren’t free — not only they take [...]

Cross-database access. Part 2 – trustworthy databases and dbo as an authenticator

In the previous part “Cross-database access. Part 1 – the worst nightmare or why applications should not use sa login” we saw what happens if an application uses sa login. Now, we are going to discuss a better and more secure, but still not the best, solution. Can a dbo access resources from another database? [...]

Useful things about data recovery that every DBA should know. Part 4 — Restore planning

In the last part of this series we are going to find an answer to the ultimate question — what backup files should be used and in what order, to restore a database to their most current state? We will examine two cases: 1. When a database is being restored on the original SQL Server [...]

Useful things about data recovery that every DBA should know. Part 3 — Three differential backups tricks

In this article we are going to answers those questions: 1. Is differential backup a cumulative, or an incremental one? 2. Why you really should take a full backup just before switching any file group to read-only? 3. Do you really need a full backup to restart a broken log backup chain? If you missed [...]

Useful things about data recovery that every DBA should know. Part 2 — What does a full backup contain?

In the first part of the series, “Useful things about data recovery that every DBA should know. Part 1 — To what point in time full backup is being restored?”, we saw, that a full backup can be only restored to the point in time when a data copy phase finished. Now it is time [...]

Useful things about data recovery that every DBA should know. Part 1 — To what point in time full backup is being restored?

Every DBA took at least once full database backup. But do you happen to know to what point in time this backup would be restored? To the moment when backup started? To the time when it finished? Or maybe there is a third option? If you had chosen one of the first two answers, you [...]

Max degree of parallelism and maintenance tasks

In this posts I would like to show you a huge drawback of another commonly seen “best practice” — the one about setting ‘max degree of parallelism’ server option to 1. What does this recommendation come from? As our machines grow bigger and bigger many database administrators and programmers find out that databases which used [...]

I don’t have a SAN, so how many tempdb files do I need? Part 2 — PFS, GAM, and SGAM contention

In the previous article I don’t have a SAN, so how many tempdb files do I need? Part 1 — When splitting tempdb into to many files can be counterproductive to performance we saw that splitting tempdb into multiple files can be problematic. Now, it is time to have a closer look at the most [...]

I don’t have a SAN, so how many tempdb files do I need? Part 1 — When splitting tempdb into to many files can be counterproductive to performance

You can find some great and overwhelming load of not so good information about optimizing tempdb performance all over the Internet. This post has one purpose — to warn you of the consequences that you will face blindly following one of those “best practices”. Namely, if somebody tells you without even checking what your storage [...]