March 3, 2005 at 9:44 am
Thanks Calvin, but like I said a few posts ago, I was really looking for a magic bullet setting or something here. I will not be using a temp table/var, or running the query twice.
March 3, 2005 at 10:38 am
I found a tip here a while ago that said there was a faster way to get the record count than using count(*)
SELECT rows FROM sysindexes WHERE id = OBJECT_ID('tblUsers') AND indid < 2
from authors a cross join sysindexes s
WHERE s.id = OBJECT_ID('authors') AND s.indid < 2
March 3, 2005 at 10:41 am
I get an 87% / 13% load... and 85% of the load of the first query goes for the count(*). The strange thing is that when I do top 500 it's more balanced (69%/31% and only 52% for count(*))... can't explain that one though except that it may be considered as a deterministic query and not reran after a few executions.
Remi,
The data from the first SELECT is cached.
The second SELECT reads the cached data, instead of reading from the original source.
March 3, 2005 at 10:50 am
thanx, PhilPacha. Looks like I wasn't complettly off target .
March 3, 2005 at 10:51 am
This wouldn't work here because it's 6 tables parametered search report.
Viewing 5 posts - 16 through 19 (of 19 total)
You must be logged in to reply to this topic. Login to reply