Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Reindex making DBC grow...
Message
 
À
17/03/2004 10:35:02
Information générale
Forum:
Visual FoxPro
Catégorie:
Stonefield
Divers
Thread ID:
00886832
Message ID:
00888096
Vues:
24
>Hi Debra.
>
>>Why does the Reindex() function increase the size of my DBC/DCT/DCX? Should I be issuing some type of PACK DATABASE?
>
>Because in order to recreate the indexes for the table, it has to delete the existing records for those indexes in the DBC. New copies of those records are then created as the indexes are created. I considered doing a PACK DATABASE at the end, but that requires exclusive access to the DBC to work, and I can't guarantee that'd be the case. So, simply do your own PACK DATABASE.
>
>Doug

I have a procedure that I run everytime I update the 1000 or so views in our DBCs that checks to see if the DBC is in use, and packs it if it is not. You could always add this to the end of your routine.


PROCEDURE PackDBC
LPARAMETERS lcFullDBCWithPath

WAIT WINDOW 'Attempting to pack ' + lcFullDBCWithPath NOWAIT

SET REPROCESS TO 5 SECONDS

ON ERROR WAIT WINDOW lcFullDBCWithPath + ' is in use.' NOWAIT

USE (lcFullDBCWithPath) EXCLUSIVE

IF FLOCK()
PACK
? lcFullDBCWithPath + ' packed.'
ELSE
? 'SKIPPED - ' + lcFullDBCWithPath + ' - is in use and cannot be packed. Try again later.'
ENDIF

VALIDATE DATABASE

CLOSE DATABASES ALL

ON ERROR
ENDPROC
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform