all groups > sql server data warehouse > october 2003 >
You're in the

sql server data warehouse

group:

READ_UNCOMMITTED and view indexes


READ_UNCOMMITTED and view indexes Terris Linenbach
10/8/2003 5:14:52 PM
sql server data warehouse:
Let's say all of my report queries use READ_UNCOMMITTED in order to avoid
deadlocking with load processes. The queries select from views which have
indexes.

Now suppose a query is running while a nightly load operation is running.
The nightly load operation inserts additional records into the database
which causes the aggregates in the materialized views to be recalculated.

The following statements are also true:

(1) The query's where clause contains a statement sort of like "select
sum(purchase_amount) where date <= 10/10/2002"
(2) The view aggregates purchase_amount for each day
(3) When the query is running, data is being inserted into the physical
table upon which the view is built

Case 1:

The new data loaded applies to 10/20/2002

Is it possible to read inconsistent aggregate data in this case? I wouldn't
expect it to, since the where clause filters out the data that is being
loaded into the star. However, I have no idea how materialized views are
actually implemented or how they have been specified to behave when
READ_UNCOMMITTED has been specified.

Case 2:

The new data loaded applies to 10/5/2002

In this case I would expect a dirty read to return inconsistent data. How
"inconsistent" can the data be? Could it be totally random or would it be
constrained between, say two values: the value before the insert operation
and the value consistent with the data in the underlying table?

Does any of this make sense?

Thanks,
Terris

Re: READ_UNCOMMITTED and view indexes Kevin
10/9/2003 3:15:44 PM
If you're using READ UNCOMMITTED, you must be trying to prevent blocking,
not deadlocking, right? deadlocks are only caused by two conflicting
updates transactions, not an update and a select.

--
Kevin Connell, MCDBA
--------------------------------------------------
The views expressed here are my own
and not of my employer.
----------------------------------------------------
[quoted text, click to view]

AddThis Social Bookmark Button