how to define alternate keys on C-ISAM data files?
Posted in 1999
Topics: Performance & Tuning
Hi, How do we define alternate keys (indices apart from primary key) on the C-ISAM datafiles? Can many alternate keys be defined on the database file prior to use of the file in the application? Are there different ways of doing this and is there any impact on performance if alternate keys are defined? Any help would be appreciated. Thanks, Yatin
Yatin Chawathe wrote: > > Hi, > > How do we define alternate keys (indices apart > from primary key) on the C-ISAM datafiles? Can > many alternate keys be defined on the database > file prior to use of the file in the application? > Are there different ways of doing this and is > there any impact on performance if alternate > keys are defined? > > Any help would be appreciated. Thanks, > Yatin Hi Yatin, do your directly use C-ISAM ? A long time ago we used C-ISAM instead of a database :-)) Okay, I'm not really sure, but I think C-ISAM supports up to 16 indexes. Indexes always have an impact on performance. It takes time to maintain indexes when you insert, update or delete a row. On the other hand it saves time when you select less than 10 percent of your data. Alternate indexes are defined by the function "isaddindex()". #include <isam.h> . . . struct keydesc key; key.k_flags = ISDUPS; key.k_nparts = 1; key.k_part[0].kp_start = yourposition; key.k_part[0].kp_leng = yourlength; key.k_part[0].kp_type = CHARTYPE; if ( isaddindex( descriptor_of_isopen, &key ) < 0 ) { printf("bullshit - what's wrong ? (%d)\\n", iserrno ); exit(1); } Some other important functions: isdelindex() isindexinfo() Bye Stefan Weideneder