Re: MIN() + MAX() Deadlock ?
From: avnrao (avn_at_newsgroups.com)
Date: 01/13/05
- Next message: filtermyspam_at_yahoo.com: "Bug in SQL Server 2000"
- Previous message: Tedy Pranolo: "What is the best way to query for used foreign key"
- In reply to: eval: "MIN() + MAX() Deadlock ?"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 13 Jan 2005 11:03:41 +0530
The only difference between the statements is with (nolock). can you check
if the second statement is trying to use parellelism in its query plan.
can you set Max Degree of Parallelism to 1 for the query and run it.
-- Av. http://dotnetjunkies.com/WebLog/avnrao http://www28.brinkster.com/avdotnet "eval" <eval@eval.com> wrote in message news:ed89SdP#EHA.2568@TK2MSFTNGP11.phx.gbl... > Hi guys > > > The only difference between the following 2 queries... > > > Select min(GpsDate) minTime, max(GpsDate) maxTime From TblAvlTrans > Where UnitID = '1720200022285010001407' > > > Select min(GpsDate) minTime, max(GpsDate) maxTime From TblAvlTrans > with (nolock) Where UnitID = '1720200022285010001419' > > > ...is that the first one takes only 36 seconds in a 21 million table > database, but the second one takes forever (last time I tried, the query > took 3 minutes and had to stop it because of blocking) > > Note that both queries are exactly the same (except for the where > clause), and both records have more or less the same amount of records > (about 100,000) > > The funny thing is that, if I get the MIN() first, and then the MAX() > for the same where clause: > > Select min(GpsDate) minTime From TblAvlTrans with (nolock) Where > UnitID = '1720200022285010001419' > > Select max(GpsDate) maxTime From TblAvlTrans with (nolock) Where > UnitID = '1720200022285010001419' > > I get the value. However, it does not work in combination. > > Also note that the problem is only with UnitId = > '1720200022285010001419' (The others work just fine) > > I checked the nulls (no nulls at all), the indices (dropped and > re-created them with fill factor of 90%, althhough it is under heavy > "insert" stress), and there seems to be no reason for this deadlock > > Any clues > > > Eval
- Next message: filtermyspam_at_yahoo.com: "Bug in SQL Server 2000"
- Previous message: Tedy Pranolo: "What is the best way to query for used foreign key"
- In reply to: eval: "MIN() + MAX() Deadlock ?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|