Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Tip of the Day --- Views (Part Next)
Message
De
28/09/1999 08:36:19
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Tip of the Day --- Views (Part Next)
Divers
Thread ID:
00269858
Message ID:
00269858
Vues:
42
When creating updatable local views, the default setting for the SQL Where clause is slow. Look at the Update Criteria tab of the View Designer. On the right is a label "SQL WHERE Clause Includes". The default choice is "Key and modified fields". This will create an update clause like this:


UPDATE MyTable WHERE Key = KeyOldVal, Field1 = Field1OldVal, Field2 = Field2OldVal SET Field1 = Field1NewVal, Field2 = Field2NewVal.


You can see that this could cause your update to be very slow. One solution is to index each field so that the UPDATE is optimized. However, this is not the best solution. Make sure you have a Primary Key in every record and select the first option in "SQL WHERE clause includes". This causes only the key field to be included and will dramatically speed up the UPDATE.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform