SQL slow datetime record search

  • Thanks guys, the difference in speed is amazing 🙂

  • Alvin Ramard (6/23/2015)


    leetrueman (6/23/2015)


    The first one

    CREATE NONCLUSTERED INDEX idx_Transactions_TransTime

    ON dbo.transactions (trans_time, SiteID)

    INCLUDE (transactionID,siteID,areacode,gamename,sitename)

    GO

    is reporting

    Msg 1909, Level 16, State 2, Line 1

    Cannot use duplicate column names in index. Column name 'SiteID' listed more than once.

    ?

    Try removing siteID from the INCLUDE clause:

    CREATE NONCLUSTERED INDEX idx_Transactions_TransTime

    ON dbo.transactions (trans_time, SiteID)

    INCLUDE (transactionID, areacode, gamename, sitename)

    GO

    Sorry about that. Copy-paste error.

    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 2 posts - 16 through 16 (of 16 total)

You must be logged in to reply to this topic. Login to reply