Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Detect CDX Bloat
Message
From
08/02/2004 16:25:42
 
 
To
08/02/2004 04:17:32
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00875209
Message ID:
00875285
Views:
23
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform