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:03:10
 
 
À
20/12/2001 11:59:14
Alexandre Palma
Harms Software, Inc.
Alverca, Portugal
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:
00596841
Vues:
18
>Hi both index are used also take a look to SYS(3054) function.
>
>>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!

Actually, the ORDER BY clause operates on the result set, so the existance of a tag on LastName in the original table isn't a help - a temporary index must be created against the resultset, which becomes disconnected from the original table unless it can be processed as a filtered view, in which case, there will be a noticable delay in navigating the resultant cursor.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform