HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

Can bad table-scan queries slow down nice index-covered queries at the same instance?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
indexcanthesamescanbadniceslowcoveredinstance

Problem

Let's say we have an instance used by two clients: me and my friend Ivan. Each of us has his own database. Each of us is only reading.

I'm a bad guy, so I'm relentlessly shooting table scans at the db. My tables are also huge, so they don't fit into memory.
Ivan is a nice guy, so all of his queries are covered by an index, so he has no reasons to hit the disk at all.

Will he notice any problems?

AFAIK, I'll have a bunch of threads sitting there in SUSPENDED state waiting for disk, and not generating too much of a load otherwise, so Ivan should do just fine.

Solution

I can definitely say "Yes, your bad query can impact Ivan's query" due to resource competition at instance level.

I have multiple databases in one production sql server box, I have seen many times that a bad query (actually a SP) in one database that caused both CPU and I/O usage skyrocketed and impact all other user sessions connected to other databases.

Besides CPU and I/O usage, one particular case is the negative impact a bad query brings to TempDB performance, and when TempDB is heavily utilized, it is a direct hit to all other queries that need to use TempDB for their executions.

Context

StackExchange Database Administrators Q#196454, answer score: 5

Revisions (0)

No revisions yet.