Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
The fastest way to move data from one table to another?
Message
De
05/01/2009 09:59:52
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01370929
Message ID:
01371011
Vues:
71
This message has been marked as a message which has helped to the initial question of the thread.
>>>>>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.


(1) I would not remove RI if I were you
(2) isn't a cursor some kind of local free table with the advantage of long field names ?
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform