Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Rushmore Optimization on Free Tables
Message
From
25/06/2003 12:59:48
Mike Yearwood
Toronto, Ontario, Canada
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00803319
Message ID:
00803868
Views:
32
Hi Allan!

There are drawbacks to using the two tags as Hilmar points out. However, there are drawbacks to using one tag too. You will have to pad your variables with spaces to match the index expression. If you also need to search by either or both of the two parts of the expression, you'd end up with 3 index tags, which could be a performance hit. I think the best overall approach is to have two tags and to use the two index expressions. That stands until performance is unacceptable or the most frequent queries use only the single tag.

>>>Sergey,
>>>
>>>I wonder if it is worthwhile to combine the two fields in the expression (as in Craig's example).
>>>
>>>>In this case you don't need compound index because you're using each field separately in your WHERE condition.
>>>>
>>>>>Is there a benefit in terms of Rushmore in creating compound indices for free tables?
>>>>>
>>>>>For example, when we extract invoice headers, part of the SQL statement might contain "where cCustomer = 'ALLAN' and cInvoiceNo = '123456'".
>>>>>Should there be an index on 'cCustomer + cInvoiceNo' as well as 'cCustomer' and 'cInvoicNo'?
>>>>>
>>>>>TIA.
>>
>>It is worthwhile, if you frequently access for that particular combination.
>>
>>
>>... where cCustomer = "ALLAN" and cInvoiceNo = '123456'
>>
>>
>>will do the following: Using the index on the field cCustomer, it will get all index keys that match the expression, cCustomer = "ALLAN". This might be a few hundred or thousand keys.
>>
>>Next, from the other index, it will get all all invoices that match the condition, cInvoiceNo = "123456". This might also be several index keys.
>>
>>Finally, it will combine the information in memory, and retrieve the records themselves.
>>
>>If you use a combined expression, and have the corresponding index, it will retrieve far less index keys, and then get the corresponding records.
>
>Thank you to all who responsed.
Previous
Reply
Map
View

Click here to load this message in the networking platform