[SR-Users] Using =~ to get the group identifier with longest match

Iñaki Baz Castillo ibc at aliax.net
Mon Jun 6 14:52:13 CEST 2011


2011/6/6 David Villasmil <david.villasmil.work at 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.

Thanks.

-- 
Iñaki Baz Castillo
<ibc at aliax.net>



More information about the sr-users mailing list