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 |
|
avijit_mca
Posting Yak Master
109 Posts |
Posted - 2010-03-03 : 12:23:26
|
| select * from employeewhere basic+bonus >8000how we make this query performance tuning in where clauseRegards,avijit |
|
|
Sachin.Nand
2937 Posts |
Posted - 2010-03-03 : 12:26:38
|
| what other columns are there in your "*"?PBUH |
 |
|
|
namman
Constraint Violating Yak Guru
285 Posts |
Posted - 2010-03-03 : 13:24:37
|
select * from employeewhere basic+bonus >8000how we make this query performance tuning in where clauseThis one is betterselect * from employee where basic > 8000 - bonusIf you create a non-clustered index on "basic" column, then cover the "bonus" column on the index, the above query must better.If the query has been run milions times a day, you should create a extra column named basicANDBonus that holds value of basic+bonus, then create a non-clustered index on that column.select * from employee where basicANDBonus > 8000.Then this query will be supper fast |
 |
|
|
avijit_mca
Posting Yak Master
109 Posts |
Posted - 2010-03-04 : 01:52:02
|
| thanksRegards,avijit |
 |
|
|
David Singleton
Starting Member
35 Posts |
Posted - 2010-03-04 : 04:14:57
|
| Wouldn't it be better to create a field BasicWithBonus, populate this as Basic + Bonus, and then index the new field?David SingletonMicrosoft MVP Dynamics NAV |
 |
|
|
|
|
|