Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Speeding up APPEND
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00475722
Message ID:
00475906
Views:
44
Michelle,

Just another idea: use scan insert endscan. It's almost the same speed is Append without indexes and you also have the full control here, so you can add Progress Bar, termination (easy for Append, though), etc.

>Have you tested this to see if it's faster than having the indexes there before the append? (I'm not asking you to do it if you haven't... Just wondering if you had...)
>
>Thanks,
>
>Michelle
>
>
>>You could loop through the indexes in the source table and build an INDEX ON command string for each index. We have similar code that looks something like this:
>>
>>
>>FOR ln_Loop = 1 TO TAGCOUNT()
>>
>>   lc_IndexExpression = "INDEX ON " + SYS( 14, ln_Loop ) + " TAG " + ;
>>      TAG(ln_Loop)
>>
>>   IF !EMPTY( SYS( 2021, ln_Loop ) )
>>      lc_IndexExpression = lc_IndexExpression + " FOR " + SYS( 2021, ln_Loop )
>>   ENDIF
>>
>>   IF DESCENDING( ln_Loop )
>>      lc_IndexExpression = lc_IndexExpression + " DESCENDING"
>>   ENDIF
>>
>>   IF UNIQUE( ln_Loop )
>>      lc_IndexExpression = lc_IndexExpression + " UNIQUE"
>>   ENDIF
>>
>>   IF CANDIDATE( ln_Loop )
>>      lc_IndexExpression = lc_IndexExpression + " CANDIDATE"
>>   ENDIF
>>
>>ENDFOR
>>
>>
>>Note that this doesn't work for Primary Key indexes that are created with ALTER TABLE <> ADD PRIMARY KEY ...
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