Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BUG: VFP7 SP1 REINDEX no longer removes BLOAT from .CDX s
Message
De
02/05/2002 15:17:32
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
BUG: VFP7 SP1 REINDEX no longer removes BLOAT from .CDX s
Divers
Thread ID:
00652071
Message ID:
00652071
Vues:
106
Bug Report: In VFP7 SP1 (don't know about VFP7 virgin), the REINDEX command does not remove the "bloat" that may exist in a .CDX.

In fact executing the command may marginally increase the size of the .CDX file.

I compiled and ran a program under VFP7 SP1 that created a 2,000,000 record table of record length 335. It had 4 index fields, all defined as "regular". Two were INTEGER keys, one started at 2,147,000,000 as it's value and decremented by 1 each record and the other starting at 1 for its value. Two were CHAR keys, a 16-byte one being set programmatically to the PADL(STR()) value of the INTEGER key started at 1 and the other a 10-byte field starting at a value of 10,000,000 PADL(STR())ed and decremented by 1. Note that neither of the CHAR index expressions included anything other than the field name - no functions.

In a first run I created the indexes AFTER having written the table, using the INDEX ON... command as required. This run produced a table with a .CDX size of 100,990,464 bytes according to FSIZE().
I then compiled/ran a program to simply REINDEX the table and the resultant .CDX size was 100,990,464 bytes.

Then I revised the first program to create the indexes while the records were being written. This run produced a .CDX of 88,113,152 bytes according to FSIZE().
The REINDEX program on this table resulted in a .CDX size of 88,145,920. This is bigger than the pre-reindex .CDX!!!!!

OBSERVATIONS:
1) INDEXes created using INDEX ON after a table is created are significantly larger than those created while records are being written.
2) .CDX file do NOT have their "bloat" eliminated by the REINDEX command. The second case run above should have eliminated significant bloat but in fact the file size increase by 32,768 (a magic number) bytes.


You doubt that REINDEX in prior releases of VFP did eliminate bloat???

First, let me refer you to thread #523073.
Then I present the results of the same tests as above run after compilation under VFP6SP5:

In the first run using VFP6SP5 (recompiled for this) I created the indexes AFTER having written the table, using the INDEX ON... command as required. This run produced a table with a .CDX size of 52,301,824 (VFP7SP1 was 100,990,464) bytes according to FSIZE().
I then compiled/ran the program to simply REINDEX the table and the resultant .CDX size was 45,715,968 (VFP7SP1 was 100,990,464) bytes.

Re-running the revised first program to create the indexes while the records were being written produced a .CDX of 67,280,896 (VFP7SP1 was 88,113,152) bytes according to FSIZE().
The REINDEX program on this table resulted in a .CDX size of 45,715,968 (VFP7SP1 was 88,145,920) bytes.

OBSERVATIONS:
1) REINDEX removed (deliberately created) bloat in BOTH runs under VFP6SP5.
2) This test confirms Christof L.'s assertion that VFP7SP1 creates substantially larger .CDX files. In fact they do border on twice the size of the VFP6SP5 .CDX files.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform