Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Any way to optimize Append from for huge file?
Message
De
03/05/2000 16:53:46
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00365681
Message ID:
00365817
Vues:
24
>Hi everybody,
>
>We're having this problem: our SQL produces ~1000000 records. SQL works fast. Then we need to place this records into Database with predefined structure, indexes, etc. So, firstly it prepares a shell Database and a table and then uses Append from command (runs DeNull program in between). This operation takes already ~15 min. and it's not finished yet. What can you suggest to optimize it?
>
>Thanks in advance.

Hi Nadya

Try this without building the indexes first. Appending to an indexed table takes longer than to one that is not indexed.

If this proves to be the problem, try indexing afterwords. If this does not save you any time, try seeing if you can eliminate some indexes.

If populating the table still takes forever, even without prebuilt indexes:

I note that you are placing it into an empty structure. This suggests a simple solution. In your SQL statement, make sure you have all field names and types Null/Nonull , data conversions exactly the way you need them -- so tht your SQL results essentially need nothing done. Look up the CASE statement in SQL to find out how to get rid of NULLs and do other types of conditional conversion. Make sure your where clause extracts only the data you need so that you do not end have to do a conditional select against this query result.

Now create empty database, and make it the default. But do not create the empty table.

To create your table:

SELECT * FROM QueryReSult INTO TABLE TargetTableName DATABASE shell_database_you_just_created.

This should go pretty fast.

Now index the table. Warning: As I said above, this may take much longer than building the table. On a large recordset like this, you may want to see if you can keep your indexes to a minimum.

Let me know if this helps.
Thanks

Gar W. Lipow
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform