April 30, 2009 at 8:33 am
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
April 30, 2009 at 8:57 am
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.
April 30, 2009 at 10:46 am
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
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply