Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Detect CDX Bloat
Message
De
08/02/2004 16:25:42
 
 
À
08/02/2004 04:17:32
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00875209
Message ID:
00875285
Vues:
21
Not tested, illustrates the idea only:
FUNCTION CDXBloatRatio
LPARAMETERS ;
  tcTableName

LOCAL ;
  lnSelected, ;
  lcTempTableName, ;
  lnRetVal, ;
  lcOldCompatible

lnSelected = SELECT(0)
lcTempTableName = SYS(2015)
lcOldCompatible = SET([COMPATIBLE])

USE (tcTableName) IN 0 SHARED
COPY TO (lcTempTableName) WITH PRODUCTION

* or, if COPY TO ... WITH PRODUCTION simply copies the .CDX,
* COPY TO ... (without PRODUCTION) and manually rebuild the indices

SET COMPATIBLE ON
lnRetVal = (FSIZE(tcTableName + [.CDX]) / FSIZE(tcTempTableName + [.CDX])) - 1
SET COMPATIBLE &lcOldCompatible

ERASE (tcTempTableName + [.*])
USE IN (tcTableName)

SELECT lnSelected

RETURN lnRetVal
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform