Hello Iņaki,<div><br></div><div>I had much the same traffic, and with a good index that wouldn&#39;t be a problem, IMHO. </div><div>You could also load the table in memory, can&#39;t be faster than that.</div><div><br></div>

<div>Of course, doing it in the config script is faster, but it limits your flexibility... just a thought...</div><div>I even got the rate and created a &quot;custom&quot; cdr for each call. we had around 4k concurrent calls at that time (like 5 years ago)</div>

<div><br></div><div>Anyway, good luck!</div><div><br></div><div>David<br><br><div class="gmail_quote">On Mon, Jun 6, 2011 at 2:52 PM, Iņaki Baz Castillo <span dir="ltr">&lt;<a href="mailto:ibc@aliax.net">ibc@aliax.net</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">2011/6/6 David Villasmil &lt;<a href="mailto:david.villasmil.work@gmail.com">david.villasmil.work@gmail.com</a>&gt;:<br>


<div class="im">&gt; I connected to mysql and ran something like:<br>
&gt; select * from routes where &#39;$rU&#39; like concat(areacode,&#39;%&#39;) order by<br>
&gt; len(areacode) desc limit 1;<br>
<br>
</div>Hi David, that would work indeed, but I prefer not to saturate the DB<br>
with such a query which cannot use table indexes. My kamailio handles<br>
2000-3000 concurrent calls and such calls come from callcenters so<br>
they are very &quot;aggressive&quot; (maybe 200-300 calls in the same second),<br>
so querying the database with a low performance query is not an option<br>
in my case.<br>
<br>
Thanks.<br>
<font color="#888888"><br>
--<br>
</font><div><div></div><div class="h5">Iņaki Baz Castillo<br>
&lt;<a href="mailto:ibc@aliax.net">ibc@aliax.net</a>&gt;<br>
<br>
_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</div></div></blockquote></div><br></div>