Walter Meester
HoogkarspelPays-Bas
Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Hi kevin,
>I have a table - field2 is indexed, field1 isn't. Does it matter which order I put the WHERE clause in when using 2 fields. ie:
>
>SELECT * FROM myTable;
> WHERE field1 = "M";
> AND field2 = "KLAWRENCE"
>
>How will SQL handle this, will it use the indexed field to optimize the SELECT or will it handle the first expression first, then check the 2nd field?
It will first process the expressions that can be optimized (field2 = "KLAWRENCE") by its index then it will retrieve the actual records from the disk and filter with the non-optimizable expressions (field1 = "M")
Walter,
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement