Sunday, May 1, 2011

Which is the most efficient way of getting number of rows in a table ?



select COUNT(0) from LiveDataRawString select COUNT(*) from LiveDataRawString SELECT


The last method is the most effiecient method of getting count.
Because display estimated execution plan gives 50%, 50%, 0% costs when all three are evaluated, and gives 99% and 1% when last are evaluated.
rows FROM sysindexes WHERE id = OBJECT_ID('LiveDataRawString') AND indid < 2

No comments:

Post a Comment

DOCKER ARG instruction as opposed to ENV instruction

  In Docker, ARG and ENV are used to define environment variables. The ARG instruction defines variables that users can pass to the builder ...