Also make sure your time column is a DateTime or SmallDateTime column, not a varchar. Time is an essentially numeric thing, and should only be converted to a text-based type for display purposes.
Some also claim that
Select count(1)
is preferable to
select count(*)
though I do not know for sure on that.
Main Topics
Browse All Topics





by: rrjegan17Posted on 2009-10-27 at 05:35:29ID: 25671661
Make sure you have index created on time column for better performance.
Since you have 400 million rows, you can incorporate Partitioning in that table to improve your query performance further.