![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
"Gareth Williams" <Gareth.Williams (AT) bromor-tr (DOT) wales.nhs.uk> wrote in message news:mailman.111114828 |
|
II 2.6/0305 (su9.us5/00) 10626 ok... can someone explain this to me... select * from clinic_diary a, clinic_look_up b where b.master_clinic_code = a.clinic_code and a.clinic_code = '575' returns instantly, where as... select * from clinic_diary a, clinic_look_up b where b.master_clinic_code = a.clinic_code and b.master_clinic_code = '575' takes around 15 seconds. The iotrace and QEP tells me that the second query is doing a full table scan of table a. |
|
So the question is - Why is the second query not chosing indexed fields? |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
"Gareth Williams" <Gareth.Williams (AT) bromor-tr (DOT) wales.nhs.uk> wrote in message news:mailman.111114828 |
|
II 2.6/0305 (su9.us5/00) 10626 ok... can someone explain this to me... select * from clinic_diary a, clinic_look_up b where b.master_clinic_code = a.clinic_code and a.clinic_code = '575' returns instantly, where as... select * from clinic_diary a, clinic_look_up b where b.master_clinic_code = a.clinic_code and b.master_clinic_code = '575' takes around 15 seconds. The iotrace and QEP tells me that the second query is doing a full table scan of table a. |
|
So the question is - Why is the second query not chosing indexed fields? |
![]() |
| Thread Tools | |
| Display Modes | |
| |