Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
The fastest way to move data from one table to another?
Message
 
 
To
05/01/2009 09:47:22
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01370929
Message ID:
01371009
Views:
63
>>>>I was doing this, but the process didn't finish in more than 2h.
>>>
>>>I think
>>>
>>>(1) select * from Current into cursor tmp readwrite
>>>(2) Manipulate tmp
>>>(3) insert into History select * from tmp
>>
>>How much memory would we need to hold 1.6MGB cursor?
>>
>>BTW, the process I ran on the Network didn't finish running the whole night, so I simply interrupted it this morning.
>>
>>I like Al's suggestions, but I'm not exactly sure how to append by chunks (10% of the file for each iteration). I will definitely try to do this next time locally and using exclusive access.
>
>(1) the memory for the 1.6 MGB does not matter - it's a local cursor - as long as you does not start up on a network drive
>(2) Record validation rules and triggers take time - and fire for each and every record
>Related tables get opened and closed for each record. You may want to open all RI related tables and leave them open during the insert. That will speed up the process a lot imo
>(3) the 10% chunks - source record number ranges, I guess - but you would need a pk check (duplicate and missing) just in case
>
>Try (2) first - see how that improves the speed

I'm thinking we need to remove indexes and RI for the history table, do the process, then restore them. Also it was a typo, I meant 1,6GB table. Also I believe we need to create a local free table as was suggested.
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