| Author |
Topic  |
|
|
shubhada
Posting Yak Master
India
117 Posts |
Posted - 04/18/2008 : 08:45:31
|
Hi, In interview i have asked follwoing question 1. U have one query ,how u will optiminze the query for bette performance. 2. Use of update statics 3. consider on one column we definde a constaint unique key and not null. so is it possible to create a primary key on the same column?
Please provide me answer for all above questions
Regards, SHubhada.
SQLTeam |
|
|
cat_jesus
Aged Yak Warrior
547 Posts |
Posted - 04/18/2008 : 11:55:32
|
1. create an index for every column in the table. 2. use to determine when backups are needed 3. If it's a numeric type, yes. Otherwise no.
;) |
Edited by - cat_jesus on 04/18/2008 11:56:07 |
 |
|
|
Van
Constraint Violating Yak Guru
456 Posts |
Posted - 04/18/2008 : 12:23:20
|
| Actually for number 3 you can if it's "int" or "bigint" as well... |
Edited by - Van on 04/18/2008 12:23:56 |
 |
|
|
tosscrosby
Aged Yak Warrior
USA
676 Posts |
Posted - 04/18/2008 : 14:35:40
|
Actually Cat, for number 1, would that be one index for each column and then one across all columns?? Never seem to get that one right!
Terry |
 |
|
|
sodeep
Flowing Fount of Yak Knowledge
USA
7173 Posts |
Posted - 04/18/2008 : 16:36:56
|
"1. create an index for every column in the table. 2. use to determine when backups are needed 3. If it's a numeric type, yes. Otherwise no. "
Not really,This is not true. 1)Depends on the query. Database tuning advisor,execution plan will better guide you about index for better performance. Too many indexes affects performance 2)Increase the performance of the query. 3)Yes as long as there is no clustered index defined
|
Edited by - sodeep on 04/18/2008 16:37:53 |
 |
|
|
tkizer
Almighty SQL Goddess
USA
35007 Posts |
Posted - 04/18/2008 : 16:55:45
|
sodeep, your sarcasm detector must not be working.
Tara Kizer Microsoft MVP for Windows Server System - SQL Server http://weblogs.sqlteam.com/tarad/ |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
Sweden
29138 Posts |
Posted - 04/18/2008 : 17:09:24
|
Maybe because he is using TINYBIT datatype?
E 12°55'05.25" N 56°04'39.16" |
 |
|
|
blindman
Flowing Fount of Yak Knowledge
USA
2365 Posts |
Posted - 04/19/2008 : 00:27:59
|
quote: Originally posted by shubhadaIn interview i have asked follwoing question 1. U have one query ,how u will optiminze the query for bette performance. 2. Use of update statics 3. consider on one column we definde a constaint unique key and not null. so is it possible to create a primary key on the same column?
Dude! Forget about optimizing! You're never going to get past the syntax errors!
e4 d5 xd5 Nf6 |
 |
|
|
tosscrosby
Aged Yak Warrior
USA
676 Posts |
Posted - 04/21/2008 : 15:51:12
|
Sarcasm? Who, me? I ask a legitimate question and now I'm accused of sarcasm? I'm just trying to figure out this here SQL, ya' know, for bette preformance and stuff!!! Backups, what's that??? Statics, that's for wimps. And, I don't even want to definde a constraint...sounds too painful.....
Terry |
 |
|
| |
Topic  |
|