Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Indexes: how is it used in SQL SELECTs?
Message
De
20/12/2001 12:50:48
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
20/12/2001 11:51:04
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00596834
Message ID:
00596875
Vues:
19
>I have a table called myTable in a database called myData. myTable has a structural (primary) index called ID on field ID, and another (regular) index called LASTNAME on field LASTNAME. In this SQL statememt:
>SELECT * FROM myTable WHERE id='0125'
>is the ID index automatically used, or do I have to specifically specify that I'd like it to use the ID index?
>How about:
>SELECT * FROM myTable WHERE id>'0125' ORDER BY LASTNAME :
>both ID & LASTNAME index automatically used?
>Thanks all!

Any index that EXACTLY MATCHES the expression on the left side will be used to optimize the record fetching - whether this makes the query faster - or slower. I'm not sure about sorting.

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform