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!

Does Rushmore need exact field names?

Status
Not open for further replies.

Kimed

Programmer
May 25, 2005
104
LT
Hi,

In a company I'm starting to work in, most FoxPro apps use complex indexes with names matching names of existing fields. That is, an index tag "field1" can contain an expression "dtoc(field1)+field2+str(field3,4)". I, on the other hand, try to make Rushmore-optimizable expressions, which usually require simple indexes... but there are already tags named after fields I need. Question is, if I write something like

INDEX ON field1 TAG field1_index

would "field1" be used in optimisation, or Rushmore needs exact matching of index and indexed field names?

Thanks.
 
Rushmore will use an index if the expression is exactly the same.
Will Rushmore use an existing index if the index expression is identical to or longer than the field(s) being searched?

Index: Field1+Field2+DTOC(Field3)

Search: Field1 (Rushmore)
Search: Field1+Field2 (Rushmore)
Search: Field1+DTOC(Field3) (out of order, not Rushmore)
Search: Field1+Field2+STR(Field4,10,2) (out of order, not Rushmore)
Search: Field1+Field2+DTOC(Field3)+STR(Field4,10,2) (longer than index, not Rushmore)

I don't have the docs handy, but I generally asumed Rushmore kicked in if the length of the expression matched the similar portion of the index. In other words, for matches it behaved as though EXACT was set OFF. Of course, I could be wrong about this, it's been a long time.
 
No, the search expression must exactly match the index expression. None of your examples are optimizable.

Tamar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top