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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

foxpro 2.6dos (Diff. between using Indexes & TAGs)

Status
Not open for further replies.

ihabaloul

Programmer
Feb 10, 2007
10
PS
I am using indexes for ordering and retreiving data sorted BUT I notices in many examples on the Internet the programmers uses the TAGs which I did not use through my programming life for more than 10 years so which better peroformance .
I use:(example)
USE TABLE_NAME
INDEX on dtos(mdate) to TABLE_NAME_INDEX1
use TABLE_NAME inde TABLE_NAME_INDEX1
set orde to 1
and so on for others indexes.
I read about: TAGs such as
INDEX ON dtos(mdate) TAG mdate ADDITIVE

ihab
 
More Info on Indexes & Tags
With Indexes, the index must be open for the index to be updated when a change is made to the table

EXAMPLE #1
USE TABLE_NAME
INDEX on field to INDEX1
INDEX on field to INDEX2
use TABLE_NAME indexes INDEX1,INDEX2
Append blank
Both Indexes are updated

EXAMPLE#2
USE TABLE_NAME
INDEX on field to INDEX1
INDEX on field to INDEX2
use TABLE_NAME indexes INDEX1
Append blank
Only Index1 is updated. If you open Index 2 you will have to reindex.

EXAMPLE#3
USE TABLE_NAME
INDEX on field tag INDEX1 [of table_name.cdx] <-optional
INDEX on field tag INDEX2
use TABLE_NAME
append blank

Both Tags were updated because the "CDX that holds the Tags" gets opened automatically when the DBF is opened (if CDX is same name as DBF) and tags are updated .

Hope this makes the Index Mud a little clearer for you.

David W. Grewe (Dave)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top