Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CDX and IDX
Message
From
05/06/1998 05:05:48
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
05/06/1998 02:31:14
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00105033
Message ID:
00105054
Views:
20
>What the different of CDX and IDX file ?, what will happen if I have one of those files (IDX or CDX) only ?, and which files that VFP used when seek command run if I have both files ?
>
>regards
>Winan
Hi Winan,
In short I would say stick with structural indexes (CDX).
Now details. Historically idx, ndx (ntx for clipper) are older than CDX. IDX (ndx) are separate index files for each of index tags, ie: if you have two indexes you have two idx files each named with their tagnames (I mean you use filename instead of tagname). A nonstructural CDX can also exist and differ from an idx keeping more than one tag in one single index file (and they are compacted to about 1/6 which is also a performance plus). With nonstructural idx or cdx you should explicitly open them to be UPDATED and in seeks the one you set order to is used (ie: use mytable index i1.idx, i2.idx order i1 - if also i3.idx exist it would be updated when it's key field(s) edited or a new rec appended, appending a record then setting order to i3.idx would cause a record out of range error, needing reindex to update). Structural CDX on the other hand (those you simply create with ie: "index on mykey tag mykey") are :
-Always opened and updated when you just open the dbf.
-They're compact,
-You have the option of having up to 240 bytes key (nonstructural 100),
-Hold many (no documentation really, says unlimited but not sure of it and never hit to a limit yet) tags in one single file (thus uses only one additional file handle - in earlier days it was more important to keep the files setting high in config.sys).
-For a cursor you could also create a structural CDX which would "fly away" when cursor closed (cool)
-No fear of an unupdated index - "record out of range error" near totally lost
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform