On Jun 6, 2011, at 2:52 PM, Iñaki Baz Castillo ibc@aliax.net wrote:
2011/6/6 David Villasmil david.villasmil.work@gmail.com:
I connected to mysql and ran something like: select * from routes where '$rU' like concat(areacode,'%') order by len(areacode) desc limit 1;
Hi David, that would work indeed, but I prefer not to saturate the DB with such a query which cannot use table indexes. My kamailio handles 2000-3000 concurrent calls and such calls come from callcenters so they are very "aggressive" (maybe 200-300 calls in the same second), so querying the database with a low performance query is not an option in my case.
Btw, very lightweight module for longest prefix matching is mtree. It has option to return a value in a cfg variable, that can be the group id for example. It does caching in memory trees, so it is really fast in matching.
Cheers, Daniel
Thanks.
-- Iñaki Baz Castillo ibc@aliax.net
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users