Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Any ideas to index/speed this up?
Message
From
22/07/2003 01:22:15
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
 
 
To
21/07/2003 16:15:04
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00810823
Message ID:
00812228
Views:
10
Steve,
I'm more familiar with SQL Select then with SET RELATION, so I tend to query the tables and do simple RELATION - REPLACE operations.
Yes it might be a little longer to first SELECT and then replace then juse SET RELATION and REPLACE. But this is a tricky thing you will do.
You may speed up the SQL SELECT if you Index some fields. Check your help for RUSHMORE optimization how to do it.

To your code using loops: I would not trust for the lenght of 13. I would get the max lenght and min length out of rate and let the loop run between those limits.


Agnes
>Thanks so much Agnes for all your help, I finally got your code running and unfortunately it took just about as long as my seek, replace and delete system.
>
>It gave me an idea though that I think might work. I'm thinking about selecting my rate tables into 13 rate tables based on the length of the rate code. Then do an inner join with the cdr on the 13 digit rates, replace them with the rate info. Next join with all the matches for 12 digit rate codes for empty(cdr.dest) , then the same for 11 digit rates, and so on.
>
>I noticed with Dan's code that the set relation was almost instant, it was just not selecting the right matches.
>
>Think this might be a quicker way?
>
>If you don't understand, here's psuedocode for what I plan to do.
>
>
>select rate
>index on code tag code
>
>select cdr
>index on len(dnis)+dnis tag dnislength
>
>for i=13 to 1 step -1
>  SELECT * FROM rate WHERE len(ALLTRIM(code))=i INTO cursor rate+(i)
>  set relation to rate+(i).code into cdr
>  set skip to cdr
>  replace rate table info for empty(cdr.dest) into cdr table
>endfor
>
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Previous
Reply
Map
View

Click here to load this message in the networking platform