<div><div><div dir="auto">Hi Henning,</div></div><div dir="auto"><br></div><div dir="auto">That’s the thing, I don’t really understand the docs, thus way opened this thread.</div><div dir="auto"><br></div><div dir="auto">Can you give me an example of what the keys modparam for dispatcher table would look like? I would really appreciate it as I don’t get it after reading the docs. </div><div dir="auto"><br></div><div dir="auto">I don’t have many gateways as this is a test env but still I want to do things the correct way. Otherwise every time I reload I get a warning in the logs and I rather avoid that warning if I can. </div><div dir="auto"><br></div><div><div dir="auto">Thanks,</div><div dir="auto">Joel. </div></div></div><div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Nov 23, 2019 at 00:34 Henning Westerholt <<a href="mailto:hw@skalatan.de" target="_blank">hw@skalatan.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="DE" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span>Hello Joel,<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">you already quoted the keys modparam docs.
</span><span lang="EN-GB" style="font-family:"Segoe UI Emoji",sans-serif">😊</span><span lang="EN-GB"> You need to add an entry for the dispatcher table to keys as well.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">How many records do you actually have in the dispatcher table? If it is a low number (like < 100) or so, it should work also fine without it. IMHO the warning is there in case people
 forget to add it on huge tables. And of course, it is “the right thing to do” from an implementation point of view.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Cheers,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Henning<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">-- <u></u>
<u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Henning Westerholt –
</span><span><a href="https://skalatan.de/blog/" target="_blank"><span lang="EN-GB" style="color:#0563c1">https://skalatan.de/blog/</span></a></span><span lang="EN-GB"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Kamailio services –
</span><span><a href="https://gilawa.com/" target="_blank"><span lang="EN-GB" style="color:#0563c1">https://gilawa.com</span></a></span><span>
<span lang="EN-GB"><u></u><u></u></span></span></p>
<p class="MsoNormal"><span lang="EN-GB">Kamailio Merchandising – </span><a href="https://skalatan.de/merchandising" target="_blank"><span lang="EN-GB" style="color:#0563c1">https://skalatan.de/merchandising</span></a>
<span lang="EN-GB"><u></u><u></u></span></p></div></div><div lang="DE" link="blue" vlink="purple"><div>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal" style="margin-left:35.4pt"><b>From:</b> sr-users <<a href="mailto:sr-users-bounces@lists.kamailio.org" target="_blank">sr-users-bounces@lists.kamailio.org</a>>
<b>On Behalf Of </b>Joel Serrano<br>
<b>Sent:</b> Saturday, November 23, 2019 1:18 AM<br>
<b>To:</b> Kamailio (SER) - Users Mailing List <<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a>><br>
<b>Subject:</b> Re: [SR-Users] Avoid full table scan for dispatcher table on db_redis using ds_reload() from config script<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:35.4pt"><u></u> <u></u></p>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">Just in case:<u></u><u></u></p>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">Kam version - latest nightly deb (5.4.0~dev1+0~20191122005600.1540+buster)<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">Redis config:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">loadmodule "db_redis.so"<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">modparam("db_redis", "keys", "version=entry:table_name")<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">...<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">modparam("dispatcher", "db_url", "redis://X.X.X.X:6379/2")<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">Thanks!<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">Joel.<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal" style="margin-left:35.4pt"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">On Fri, Nov 22, 2019 at 1:48 PM Joel Serrano <<a href="mailto:joel@textplus.com" target="_blank">joel@textplus.com</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<p class="MsoNormal" style="margin-left:35.4pt">Hello, <u></u><u></u></p>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">I'm trying out redis as db backend, and right now I only have dispatcher records there... Every so often, I do a ds_reload() from within Kam config script, and I see in logs:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:12.0pt;margin-left:35.4pt">
<br>
Nov 22 20:36:35 test COPS[25531]: WARNING: db_redis [redis_dbase.c:1098]: db_redis_perform_query(): performing full table scan on table 'dispatcher' while performing query<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">After enabling debug logs:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:12.0pt;margin-left:35.4pt">
Nov 22 21:15:35 test COPS[26661]: DEBUG: db_redis [redis_dbase.c:1761]: db_redis_query(): querying prefix (table) 'dispatcher'<br>
Nov 22 21:15:35 test COPS[26661]: DEBUG: db_redis [redis_dbase.c:1811]: db_redis_query(): no columns given to build query keys, falling back to full table scan<br>
Nov 22 21:15:35 test COPS[26661]: DEBUG: <core> [db_res.c:119]: db_new_result(): allocate 56 bytes for result set at 0x7f0be4273898<br>
Nov 22 21:15:35 test COPS[26661]: DEBUG: <core> [db_res.c:156]: db_allocate_columns(): allocate 40 bytes for result names at 0x7f0be4273938<br>
Nov 22 21:15:35 test COPS[26661]: DEBUG: <core> [db_res.c:167]: db_allocate_columns(): allocate 20 bytes for result types at 0x7f0be42739c8<br>
Nov 22 21:15:35 test COPS[26661]: WARNING: db_redis [redis_dbase.c:1098]: db_redis_perform_query(): performing full table scan on table 'dispatcher' while performing query<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">Given the msg... "no columns given to build query keys, falling back to full table scan", I assume I'm missing a keys modparam.. but I don't know how to build it, and the docs (to me) seem confusing?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><a href="https://kamailio.org/docs/modules/devel/modules/db_redis.html#db_redis.p.keys" target="_blank">https://kamailio.org/docs/modules/devel/modules/db_redis.html#db_redis.p.keys</a><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">Can anyone help me understand how to build the keys modparam for dispatcher table? Or if the reason for this is different, what do I need to do to avoid the full table scan and the warning in the log?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">Thanks, <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt">Joel.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:35.4pt"><u></u> <u></u></p>
</div>
</div>
</blockquote>
</div>
</div>
</div>

</blockquote></div></div>
</div>