Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Increasing speed in memo search.
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00112313
Message ID:
00112318
Vues:
26
>Recently I came across a requirement of a client where i have to search for a string or group of words in memo from the table consisting of 33,000 records and each record has a memo of
>minimum 50 lines.

The fastest way I have found to do ad-hoc searches of memo fields is simply:
Set order to 0   && this is pretty important as you will be doing a table scan
Scan for cSearchString $ MemoField
  * Do whatever you want to do with each found record
EndScan
If the search needs to be case-insensitive:

cSearchString = Upper(cSearchString)
Scan for cSearchString $ Upper(MemoField)

If you have the disk space, you can replicate the memo field as an all-uppercase clone and search on this. It will speed things up just a bit by avoiding the UPPER() function.

Memo searches go quite a bit faster if your memo file is nice and compact (i.e., not many deleted memos). There are commands available to clean up and compact a memo file. You can also speed things up a bit by using an optimized BlockSize. Read about this in help. The Memo file has to be created with your desired BlockSize in order for the value to have any effect.

If you need instantaneous response time, consider PHdBase.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform