Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
rajkhd
Starting Member
2 Posts |
Posted - 2007-02-28 : 23:58:06
|
| I am trying to use indexes in the table to improve the query performance. In the where clause, I am having indexed and unindexed columns.In the where condition I am using 'and' and using indexed and unindexed column. What should be the order in the filter. Do, I need to have indexed column first and the unindexed next. I am actually querying from a table which have 8 lakh rows.? Any inputs will be appreciated. Is there any good article available?Thanks |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2007-03-01 : 04:49:26
|
| Order of the columns in the where clause makes no difference (at least it shouldn't).Best performance will be of all columns included in the query are included in the index (covering). Usually this means indexing those in the where clause and including those returned.If the index isn't covering then the optimiser may decide on a poor plan and it might be better to run two queries - one getting the PK's and one returning the results (maybe using a derived table or a temp table) but you won't know without testing.It's v2000 so ignore the bit about included columns.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
rajkhd
Starting Member
2 Posts |
Posted - 2007-03-01 : 06:19:15
|
| Thanks for the reply.I am querying with a flat table and index doesn't improve performance.Any inputs to improve will be grateful.thanks |
 |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2007-03-01 : 10:34:37
|
| Can you post the query and table structure.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
|
|
|