Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Any ideas to index/speed this up?
Message
From
16/07/2003 16:37:12
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Any ideas to index/speed this up?
Miscellaneous
Thread ID:
00810823
Message ID:
00810823
Views:
49
I'm rating phone call records based on 2 tables: call records, and rates.

Here's some data for example

Callrecords.dbf
DialedNo Duration Rate Charge
0115526960000 5mins ?? ??
0115089999999 6mins ?? ??

Rates.dbf
DialCode RatePerMin
01155 .10
0115 .05

Currently I index the rates table on the the length of dial code and on dial code(i.e. len(dialcode)+dialcode ). Then I scan call records for a match (starting with the longest dial code), replace the rate and charge with values calculated from the rates table, and temporarily delete the call record (so it can't match a shorter dial code). Then jump to the next rate, scan the call records again etc. for however many rates I have (often 2000 of them) with big call record files (sometimes 1/4 million records) this can take forever.

Anyone have any ideas to speed this up? Is there some way I could relate these tables on the longest match of DialedNo to DialCode? (If so then I could do all my replacements on a single pass through the CallRecords table)

Thanks so much for any ideas,
Steve
Next
Reply
Map
View

Click here to load this message in the networking platform