Forum Replies Created

Viewing 15 posts - 34,741 through 34,755 (of 49,552 total)

  • RE: Unexpected !!!!!!!!!!! having CLUSTERED INDEX SEEK

    Scan = read of all of the pages of the index. If that's the cluster, it's every single page in the table. Seek = navigating directly to the rows needed...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Timing Statistics Inconsistent with XML Query plan

    Interesting. Going to have to play with this a bit...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Need confirm this problem

    Because order is not guaranteed unless you specify an order by. It may be the same this time, but that doesn't mean it always will.

    If there's no order by,...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Question On Indexing

    How often do you filter just by account? How often do you filter by just postdate?

    Oh, and do you really need every single column in the table? If not, lose...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Your own SPID

    homebrew01 (1/12/2010)


    Maybe a long running select could use NOLOCK,

    Aaahhhhh!!

    Why does everyone recommend nolock any time there's a long running select? How about tuning the query, tuning the index and...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: selecting TOP row from a result set

    So does the code I gave you work or not? And if not, what's wrong with it?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Timing Statistics Inconsistent with XML Query plan

    Is that the only 'parse and compile' line? I just did my own test (with a stored proc and a clear plan cache), and got the following.

    SQL Server parse and...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: selecting TOP row from a result set

    Welsh Corgi (1/13/2010)


    I believe all that I need is an outer and an inner sub query with a SELECT TOP and an Order by clause to get the...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: How do you limit records using Distinct and Count - TOP and Rowcount dont work ?

    ifila (1/13/2010)


    Please find attached the execution plan.

    Thanks

    Will check tomorrow. Is late here.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: selecting TOP row from a result set

    Oh, agreed. Which is why, when these questions come up (and they're quite frequent), I'm always very pointed in asking what the definition of 'first record' is.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Can we have a primary key on one column and clustered index on other column of the same table?

    Jason Pociask (1/13/2010)


    If you can afford index rebuilds as needed and/or enough free space in pages to handle a significant percentage of dispersed or non-increasing inserts then you could consider...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: selecting TOP row from a result set

    shannonjk (1/13/2010)


    If you only want to return one row of data per account number, then why return the address or phone number or any other data? It would be kind...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Can we have a primary key on one column and clustered index on other column of the same table?

    Jason Pociask (1/13/2010)


    Therefore the clustered index should be intended to support the most intensively used sets of common key values whether its certain queries or update/insert transactions.

    That's one of...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Row locking and Table locking

    Hard (near impossible) to say.

    I suggest you set up a test database somewhere and try out both options. See how fast the archive and delete are with the cluster on...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: How do you limit records using Distinct and Count - TOP and Rowcount dont work ?

    ifila (1/13/2010)


    What performance improvement might that provide?

    BTW based on some initial performance testing with Gail's solution:

    If i set TOP 60000 using her query it takes 8 seconds to get the...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 15 posts - 34,741 through 34,755 (of 49,552 total)