lookup based on rules
Posted: Mon Dec 27, 2004 8:18 am
For an aggregation of (telephony)call-data I need to find the type of call.
This is based on the first digits of the number being called(usually called the significant digits). Problem however is that the number of digits that matters is not always equal. sometimes first 2 is enough, but it can go up till the 8 first that can make a difference.
The way it is done now is to create all necessary substrings (2char,3char,...8char) and then do the 7 lookups. After these are done logic is applied to find the correct one(if 8char<>NULL, use this, else if 7char<>NULL,....) Since this is done for daily millions of records this takes too much time.
Any ideas on other ways of working?
This is based on the first digits of the number being called(usually called the significant digits). Problem however is that the number of digits that matters is not always equal. sometimes first 2 is enough, but it can go up till the 8 first that can make a difference.
The way it is done now is to create all necessary substrings (2char,3char,...8char) and then do the 7 lookups. After these are done logic is applied to find the correct one(if 8char<>NULL, use this, else if 7char<>NULL,....) Since this is done for daily millions of records this takes too much time.
Any ideas on other ways of working?