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
 EvalPleae don't multi-post.
--
http://www.aspfaq.com/
(Reverse address to reply.)
"eval" <eval@.eval.com> wrote in message
news:OHg3EdP#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|||Aaron [SQL Server MVP] wrote:
> Pleae don't multi-post.
>
Sorry for the multipost.
My mistake :+)
Subscribe to:
Post Comments (Atom)
 
No comments:
Post a Comment