• Sean Lange - Thursday, October 19, 2017 3:30 PM

    Oh how I love third party databases. I have been working with this one off and on and am always surprised that the table I am looking at doesn't have a primary key so just for giggles I ran these two queries.


    select count(*) from sys.tables
    select count(*) from sys.indexes where type_desc = 'HEAP'

    tables = 495
    heaps = 433

    And people wonder why this system is so slow. :crying:

    My favorite recently, the first of those would have returned around 120.
    SELECT COUNT(*) FROM sys.indexes where index_id > 1
    returned 0.

    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