Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Inserting record with non-blank memo fileds is slow
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00150117
Message ID:
00157528
Vues:
25
>>>>>>VFP 5.0a + SP3 + SQL Server 6.5
>>>>>>
>>>>>>I must have done something very wrong. A remote view with a memo field and a few other fields. If I add a new record with the memo field filled, it takes some 5 minutes to TABLEUPDATE() and I can see the intens hard disk activity of the server. However:
>>>>>>1) If I add a new record leaving the memo field blank, it is fast.
>>>>>>2) If I edit an exsiting record with or without memo contents, it is fast.
>>>>>>
>>>>>>Chen
>>>>>
>>>>>
>>>>>If your table is dynamic, then your primary key index should be Non Clustered.
>>>>>If your table is Static (such as reference Tables) then your primary key index should be Clustered.
>>>>
>>>>Thanks for the reply Nabil,
>>>>
>>>>I use surrogate keys exclusively and I never make the primary key index to be clustered, instead, most of time I reserve the clustered index for the 'real key'. If the clustered index is the point then I fail to undersatand why the inserting speed differs so greatly between a record with filled memo field and a record with a blank memo field. It is instant to insert for later case.
>>>>
>>>>Chen
>>>
>>>As far as I know that if you add a record to a table with a clustered index, then this record will be placed immediatly in the correct sorting order.
>>
>>Thanks again,
>>
>>I hope I can receive some more tips. If not, I think I will have to rewrite the save routing so that it will issue TABLEUPDATE() twice, inserting the new record without any memo contents for the first time, and update the record with memo contents at the second time. However, I think it will take a lot of writng and it sounds stupid.
>>
>>Chen
>
>I ran into the same situation and originally wrote a small routine that used SPT that issued an update setting the memo field to ''. The issue seemed to only occur when the memo field allowed NULL, and was updating the NULL value. I presume it is a problem in the ODBC driver, as the update is instantaneous with SPT.
>
>My second solution proved a little more practical as I defined the memo fields as NOT NULL with a DEFAULT '' clause. This solved the problem for me.


Brad, Can I get a copy of how you did that with SPT? I have the same problem and this would help me greatly! Thanks...
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform