troubleshooting Question

Visual FoxPro 9: Indexing question

Avatar of cmmcginn
cmmcginnFlag for United States of America asked on
FoxPro
20 Comments11 Solutions2428 ViewsLast Modified:
I have a program that constructs a database from a flat data file.  The database includes two tables.  One table has a single record for each person.  Another table has numerous records for each person.  When I construct the latter table, I index it on a key shared with the first table and a second key to make sure the records are in ascending order for each person.

In various programs I have written to work with these two tables, before I set a relation between the first table and the second, I issue INDEX instructions so the SET RELATION instruction will work.  I only issue an INDEX instruction on the one common key between the two tables, though.  Is there any reason I should be concerned that the records in the second table might get out of ascending order if I don't issue the INDEX instruction including the second key when I index the second table?  I can't imagine why VFP would change the order of the records (out of ascending order) when an INDEX instruction is issued.  Would it be a "best practice" to always issue INDEX instructions on the second table with both keys specified the way they are when the table is first created?

My programs work fine, so indexing with the second key doesn't appear to be necessary.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 11 Answers and 20 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 11 Answers and 20 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros