Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Speed query with rushmore index
Message
 
To
10/03/2007 18:02:34
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 5
Miscellaneous
Thread ID:
01202405
Message ID:
01202837
Views:
7
>You have to try it out, it's never possible to calculate how fast a query will run. However, with the right indexes, your query should be almost instant.

After all, I just needed an inner join which runs very fast without the indexes. But I tried your suggestion on another query w/o succes, somehow I can't seem this to work. It's a very simple query with the right indexes in the right place:
Select mutbdrg.*;
from mutbdrg;
inner join mutaties;
on mutaties.mijbrpls = mutbdrg.mijbrpls and mutaties.vlgnr_mut = mutbdrg.vlgnr_mut;
where year(mutaties.verw_mut) = 2007;
into cursor curMutaties
I opened the database and set an index on mijbrpls, vlgnr_mut for both mutaties en mutbdrg. Furthermore an index on verw_mut for mutaties. But the query is very slow.... I have to say the tables are big: Mutaties(5 million),mutbdrg(8 million)

Am I doing something wrong?






>
>And, to make it clear, if these index tags exist, you don't have to do anything, everything is done "automagically" by VFP. Run my code to create the indexes, and leave the rest to VFP.
>
>>True, I have never used indexes to speed up queries. Now I have a better understanding,I was wondering if I could calculate the speed of a query given these indexes. Giving this query in my message how fast should it run with these indexes?
>>
>>>It looks to me that you don't understand the concept of structural indexes. If >you create an index using the TAG keyword, the index is created in a CDX file with the same name as the DBF. The CDX will automatically be "connected" and updated whenever you use the DBF. This means that once the index tag is used, you can more or less forget about it, everything is handled automatically. Open help on the Index command, for more info.
>>>
>>>In this case, you do this ONCE, but observe that you must do it when nobody else uses the tables:
>>>Use fondsen exclusive
>>>Index on fonds_cd tag fonds_cd
>>>Use koers_hist_tot exclusive
>>>Index on fonds_cd tag fonds_cd
>>>Index on dat_krs tag dat_krs
>>>Use
Zakaria al Azhar
My blog on Actuaris.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform