Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Delete record is slow
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00829065
Message ID:
00829103
Vues:
23
Hi Chuck,

you can use a query optimization:

* if nproperty is unique
SELECT propnum
* SET ORDER TO pk
FOR i = 1 TO ALEN(.aRemovePN)
  DELETE NEXT 1 WHILE SEEK(.aRemovePN[m.i]) 
ENDFOR
* else
* first : copy array column property to a private array 
PRIVATE aCache
IF ACOPY(.aRemovePN,aCache)>0
  SELECT propnum
  IF ALEN(aCache)<2 && you can try 3 ..... 5 
     * this is a scan table not optimizable
     DELETE FOR ASCAN(aCache,nproperty)>0 NOOPTIMIZE
  ELSE
     FOR i = 1 TO ALEN(aCache)
       DELETE FOR nproperty = aCache[m.i] && this optimizable
     ENDFOR
  ENDIF
ENDIF
Fabio
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform