Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IDX and CDX 1

Status
Not open for further replies.

fkwong

Programmer
Jul 5, 2002
65
US
I have a table that has both IDX and CDX. When I open the table with this command USE ABC INDEX TEST.IDX, I also see the CDX tags with DISP STAT command. Is that mean that Foxpro will use the Rushmore technology if the Query Expression matches the 'Tag' expression?

Thanks in advance.
 
A structural compound index file is a .CDX file with the same name as the table - it will open automatically when the table is USEd. Yes, Rushmore will use the index(es) in the .CDX file if the expressions used in the WHERE clause (for example) match one or more of the index expressions contained in the .CDX ("tag expressions"). Note that SET INDEX TO Test.IDX can actually end up slowing down the record retrieval as Rushmore will use the appropriate indexes if they exist to it's benefit, then present the results in the order of Test.IDX, thereby sending the query through multiple processes to get the records - potentially in the same order. Some empirical testing may help determine if this is a factor in your instance....

Hope this helps.
Dennis
 
Let me add to this. It would be wise to eliminate the .IDX file. First, you have to make sure it is opened along with the table in order to keep it int sync. Second, you have an extra file opened which needs updating whenever the table gets updated. So you have i/o to perform for three tables instead of two. This can really degrade performance.
Dave S.
 
My two cents....

The CDX index is opened and set to the primary key when the table is is first opened. This is an implicit/b] reference (command).

USE mydbf (cdx file opens with this command)

whereas....

The IDX index must be opened manually an explicit command.

USE mydbf
SET ORDER TO mydbf.idx

HTH - Wayne
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top