Count Performance

  • Hi everyone, is there to way improve count performance, i have a simple

    select count(columnA) from table1

    thing is, its called alot by one of our applications.

    column being counted is a PK and datatype varchar(128)

    thanks

  • What indexes do you have on the table.

    Also use

    select count(*) from Table1

    if you want a row count as this allows the optimizer to pick what is the most efficent count.

  • http://sqlinthewild.co.za/index.php/2009/04/14/on-counts/

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

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