Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Slow sql
Message
De
27/02/2001 23:13:51
Edward See
Magicalogic Consultancy System
Quezon, Philippines
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Titre:
Divers
Thread ID:
00477363
Message ID:
00480394
Vues:
16
>Hello,
> I actually just deleted all the tags last night because we had this speed issue for little over a week now. I was saying may be I need to modify the reindexing program instead of issuing a reindex command I am going to delete all the tags for each table and recreate all the tags each night. I guess that will be a good idea. thanks for all your inputs.
>sherry

Hi sherry, I have this routine in use for quite sometime for auto deleting tag all, hope this might help.
By the way , I have all the DBFs under subdirectories :
i.e. customer\customer.dbf
i.e. item\item.dbf
i.e. sales\sales_parent.dbf
i.e. sales\sales_child.dbf
The program will delete all .cdx 4 deep in subdirectories in case you have
i.e. sales\history\1999\sales\sales.dbf

Please help me to refine the code 4 deep as a recursive routine. I do not know how.

PROCEDURE deletecdx
LOCAL i1,i2,i3,i4,i5,j,k,temp,x1,x2,x3,x4,x5,zz
*
IF MESSAGEBOX('This will Delete All Indexes of the Tables you are using, Proceed ?',1+16)<>1
RETURN
ENDIF
IF MESSAGEBOX('Before we can proceed, make sure all users are not using the program, Proceed ?',1+16)<>1
RETURN
ENDIF
CLOSE TABLE ALL
*
x1=ADIR(arr1,'','D')
IF BETWEEN(x1,0,2)
MESSAGEBOX('No Subdirectories to process',64)
RELEASE arr1
RETURN
ENDIF
*
FOR i1=3 TO x1
=nowait('Deleting .CDXs of Directory '+arr1[i1,1])
DELETE FILE (arr1[i1,1]+'\*.CDX')
x2=ADIR(arr2,arr1[i1,1]+'\*.*','D')
*
FOR i2=3 TO x2
DELETE FILE (arr1[i1,1]+'\'+arr2[i2,1]+'\*.CDX')
x3=ADIR(arr3,arr1[i1,1]+'\'+arr2[i2,1]+'\*.*','D')
*
FOR i3=3 TO x3
DELETE FILE (arr1[i1,1]+'\'+arr2[i2,1]+'\'+arr3[i3,1]+'\*.CDX')
x4=ADIR(arr4,arr1[i1,1]+'\'+arr2[i2,1]+'\'+arr3[i3,1]+'\*.*','D')
*
FOR i4=3 TO x4
DELETE FILE (arr1[i1,1]+'\'+arr2[i2,1]+'\'+arr3[i3,1]+'\'+arr4[i4,1]+'\*.CDX')
*
x5=ADIR(arr5,arr1[i1,1]+'\'+arr2[i2,1]+'\'+arr3[i3,1]+'\'+arr4[i4,1]+'\*.*','D')
FOR i5=3 TO x5
DELETE FILE (arr1[i1,1]+'\'+arr2[i2,1]+'\'+arr3[i3,1]+'\'+arr4[i4,1]+'\'+arr5[i5,1]+'\*.CDX')
NEXT
RELEASE arr5
*
NEXT
RELEASE arr4
*
NEXT
RELEASE arr3
*
NEXT
RELEASE arr2
NEXT
RELEASE arr1
CLOSE TABLE ALL
MESSAGEBOX('The program has successfully deleted all indexes and will now exit, please run the program again',48)
Use things, not people. Love people, not things
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform