Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What are the best indexes to have for a filter ?
Message
From
11/01/2005 15:54:49
 
 
To
11/01/2005 15:29:22
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00975956
Message ID:
00976150
Views:
9
>That would depend on how many records are selected in the first phase, right? I suspect that if many records are selected in the first phase, it might get quite slow. I believe you have managed to avoid this.

Yes, I avoided that by sorting my array, as I wrote. Anyway, my solution is generic, so I have made a function out it, I use this function many places in my systems. It has saved me a lot of time of programming, and my searches are always at least partially optimized.
>
>I think that creating a single query with a combined condition would be still faster, but quite often, it is better to do whatever is fastest to program.
>
>>No, on the contrary, it's very fast! Notice that the first search is fully optimized, and the next searches are done in RAM. In my case I have a table with about 6 million records, and the search is always immidiate. In reality the total speed depends on how many records you get in the first SELECT. In my system I have a function to sort the laCondition array so the longest condition is in the first element, since this condition normally will get fewest records which is a plus.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform