Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Tip of the Day --- Views (Part Next)
Message
From
28/09/1999 08:36:19
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Tip of the Day --- Views (Part Next)
Miscellaneous
Thread ID:
00269858
Message ID:
00269858
Views:
44
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
Next
Reply
Map
View

Click here to load this message in the networking platform