in reply to Re: Searching and sorting a large DBF file
in thread Searching and sorting a large DBF file

An index is a database object used for doing fast lookups on particular pieces of data. i.e.

select column1,colum2 from table1 where column1 = 'bob'

would be slow if there were a million records. But, if there was a structure that was faster to do a lookup on, an index, existed for this table, lookups would be faster. Indexes are seperate from tables as they are optimized for specific pieces of data. To use an index that you create, look up your db manual, just use it in the where clause somehow.

select col1,col2 from table1,table2 where table1.col1='bob' and table2.col2=table1.col2
This would join fast if there was an index on col2, and would also be fast on finding 'bob' if there was an index on col1.

Further more, indexes don't work well when you transform data. Doing ...

select * from table where col1*2 = 50
would never use an index, as you are comparing 50 to mutated data. If you did co1=50, it would be fine. There's an index on the values of the table, not the values that you mutate like above.