
Signature
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp
>> I am experiencing the following problem;
>>
[quoted text clipped - 34 lines]
> The query itself would benefit enormously by a non-clustered index on
> postoffice.
Thanks for a well-written answer!
I guess my expectations on selecting based on a non-indexed column were
somewhat high. When I added an index, my query executes in seconds.
One index solved this problem, but my table contains 30-40 similar columns,
and I don't think indexing every column is a good idea.
Isn't there any other ways of speeding up selects? Well, I guess not...
/Magnus
Erland Sommarskog - 29 Aug 2005 13:40 GMT
> I guess my expectations on selecting based on a non-indexed column were
> somewhat high. When I added an index, my query executes in seconds. One
> index solved this problem, but my table contains 30-40 similar columns,
> and I don't think indexing every column is a good idea.
>
> Isn't there any other ways of speeding up selects? Well, I guess not...
Well, once data is in cache it will be faster. Or at least less slow.
But if you need to do this on every column, it sounds to me like one
of those things Analysis Services is good for.

Signature
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp
Robert Klemme - 29 Aug 2005 15:28 GMT
> I guess my expectations on selecting based on a non-indexed column
> were somewhat high. When I added an index, my query executes in
> seconds.
> One index solved this problem, but my table contains 30-40 similar
> columns, and I don't think indexing every column is a good idea.
Two things come to mind:
1. rethink your table design. If these columns are so similar you might
be better off with a second table which is joined. But that of course
depends on your data - just an idea.
2. Create indexes (possibly composite indexes) for most used queries. You
might even get away with a single (or few) composite index if your queries
only use a leading portion of this index's fields.
> Isn't there any other ways of speeding up selects? Well, I guess
> not...
Well, there are tons of other options, like having data files on several
disks, putting tx log on a separate disk, adding memory, .... It all
depends. :-)
Kind regards
robert
Magnus Österberg - 31 Aug 2005 07:26 GMT
Thank you Robert, these all are things that I'll keep in mind.
One more thing though; why is the sqlservr.exe process consuming 395 mb RAM
when the entire server is idle?
My "cron job" is inserting a few 1000 rows of data at night, but now it is
late morning here in Finland, and the entire machine is more or less idle.
On my other servers, the RAM consumption on idle is about 20-30 mb only.
Anyone got any ideas?
/Magnus
>> I guess my expectations on selecting based on a non-indexed column
>> were somewhat high. When I added an index, my query executes in
[quoted text clipped - 22 lines]
>
> robert
Erland Sommarskog - 31 Aug 2005 08:42 GMT
> One more thing though; why is the sqlservr.exe process consuming 395 mb
> RAM when the entire server is idle?
I believe that was in my first reply.
SQL Server is designed to get as much memory as it can, and only yield
if an another application needs it. This is because it keeps data in
cache so that future requests for the same data can be answered without
reading from disk.
Thus, this is perfectly normal behaviour.

Signature
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp
Robert Klemme - 31 Aug 2005 09:24 GMT
>> One more thing though; why is the sqlservr.exe process consuming 395
>> mb RAM when the entire server is idle?
[quoted text clipped - 7 lines]
>
> Thus, this is perfectly normal behaviour.
Adding to that max memory consumption is easily configurable so if 400MB
is too much for you then simply turn that down.
Kind regards
robert