Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Rushmore Optimization on Free Tables
Message
From
24/06/2003 15:53:52
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00803319
Message ID:
00803472
Views:
17
>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.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform