Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Search to determine existance of a record
Message
 
 
À
29/03/2001 14:28:46
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00490010
Message ID:
00490020
Vues:
10
>I have a table with close to 1 million records. My program imports new records from a text file selected by the user into this table. The table has a field listing the name of the file that each record came from. Is there an efficient way to search the table to see if a file already exists i.e. see if the file has already been imported. I'm currently using a simple select statement that searches for the filename in question but that has become incredibly slow.
>
>Kris H.

Is the table indexed at all? If not, you could add an index on the filename field and perform simple seek() to determine if the file name exists.

The SQL statement is going through the entire table to find all occurences of the file name you specify. Without an index, it has to do a brute force comparison for all records. As your table continues to grow, it will keep getting slower and slower.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform