Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Replace In - is it slow?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00496131
Message ID:
00496151
Views:
9
Hi George,

I found the reason for slowness. You will laugh: I forgot to select WorkFile and therefore I scaned the main database table with 1,2 mln. records in it. No wonder, why it was so slow :)

>>Hi everybody,
>>
>>I wrote a simple function to update our database with data in external file. The function looks like:
>>
>>  scan && External file
>>  if seek(PropID, "AssrMstr","PropID")
>>    replace APN with WorkFile.APN,... in AssrMstr
>>  else
>>    insert into AssrMstr ...
>>  endif
>>  endscan
>>
>>It works very slowly. The external file has ~60000 records. What could be wrong here and should I change algorithm to switch between aliases instead of using IN clause.
>>
>>Thanks in advance.
>
>How many INSERTs are typically done? How many index keys on the table? Anytime you add a record to a table with a compound, compact CDX, it has to update the index as well. If multiple keys are present this will also be true in instances where replaces are done if one of the indexed fields is modified.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform