Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Delete record is slow
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00829065
Message ID:
00829103
Views:
24
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform