Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BINTOC() and CDX size
Message
De
10/01/1999 08:21:53
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00173567
Message ID:
00174479
Vues:
28
>I am experimenting with using BINTOC() on some integer indexes. I have a table I expect to be very large and would like to make the indexes as compact as possible.
>
>I added 15,000 dummy records to my test table and checked the CDX file. It was 279,552 bytes for just integer keys.
>
>I changed all four index expressions to BINTOC( ... ), reindexed, refreshed the view in file explorer and expected the CDX file to be smaller, but it wasn't--exactly the same # of bytes.
>
>I am missing something? Thanks.

BinToC() is exactly the function VFP internally uses to create sortable 4-byte combinations for integer keys. It actually adds a 0x7fffffff to the number, so the negative numbers don't appear greater than positive. Using BinToC() simply changes your data type from integer into character, but it's still the same four bytes which VFP uses in both cases. Though, having them represented as characters does allow for concatenation, which is quite handy. I already have some tables where I have a PK constructed as BinToC(FKey)+BinToC(LocalKey) and such.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform