<div dir="ltr">Hello Daniel,<div>I am load testing it and after tens of millions of records, there were no issues.</div><div>So I will push this to production.</div><div>Thank you,</div><div><br></div><div>Regards,</div><div>Takeshi<br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 27, 2015 at 4:41 PM, Daniel-Constantin Mierla <span dir="ltr"><<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
Hello,<br>
<br>
iirc, Kamailio does only insert operations, therefore if you tested
and works, then should be no problem, because there is no select to
retrieve the values back in kamailio.<br>
<br>
Cheers,<br>
Daniel<div><div class="h5"><br>
<br>
<div>On 21/07/15 00:07, mayamatakeshi wrote:<br>
</div>
</div></div><blockquote type="cite"><div><div class="h5">
<div dir="ltr"><br>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Tue, Jul 21, 2015 at 6:35 AM,
mayamatakeshi <span dir="ltr"><<a href="mailto:mayamatakeshi@gmail.com" target="_blank">mayamatakeshi@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr">
<div>Hello, </div>
<div>I am planning to enable acc cdr in my kamailio 4.1
server.</div>
<div>I am testing in my lab and it is working fine.</div>
<div>However, when I check the table definition I see
this:</div>
<div><br>
</div>
<div>
<div>mysql> describe acc_cdrs;</div>
<div>+------------+------------------+------+-----+---------+----------------+</div>
<div>| Field    | Type       | Null | Key |
Default | Extra      |</div>
<div>+------------+------------------+------+-----+---------+----------------+</div>
<div>| id     | int(10) unsigned | NO  | PRI |
NULL Â Â | auto_increment |</div>
<div>| start_time | varchar(32) Â Â Â | NO Â | MUL | Â
   |         |</div>
<div>| end_time  | varchar(32)    | NO  |   | Â
   |         |</div>
<div>| duration  | varchar(32)    | NO  |   | Â
   |         |</div>
<div>+------------+------------------+------+-----+---------+----------------+</div>
<div>4 rows in set (0.00 sec)</div>
<div><br>
</div>
<div><br>
</div>
<div>The *_time and duration columns are defined as
varchar.</div>
</div>
<div>Because of this, i need to perform a cast when
doing queries:</div>
<div>Â select * from acc_cdrs where cast(start_time as
unsigned) >= 1437120622;</div>
<div>which would cause extra processing in the db
server.</div>
<div><br>
</div>
<div>So I experimented changing these columns to "int
unsigned" and to "float unsigned" and it worked for
both without problems (records properly added to
acc_cdrs and no errors in kamailio.log):</div>
<div><br>
</div>
<div>
<div>alter table acc_cdrs modify start_time int
unsigned;</div>
<div>alter table acc_cdrs modify end_time int
unsigned;</div>
<div>alter table acc_cdrs modify duration int
unsigned;</div>
<div><br>
</div>
<div>alter table acc_cdrs modify start_time float
unsigned;</div>
<div>alter table acc_cdrs modify end_time float
unsigned;</div>
<div>alter table acc_cdrs modify duration float
unsigned;</div>
</div>
</div>
</blockquote>
<div><br>
</div>
<div>Actually, checking again, they should not be a "float
unsigned" but "double unsigned":</div>
<div><br>
</div>
<div>
<div>alter table acc_cdrs modify start_time double
unsigned;</div>
<div>alter table acc_cdrs modify end_time double unsigned;</div>
<div>alter table acc_cdrs modify duration double unsigned;</div>
</div>
<div><br>
</div>
<div>Â </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr">
<div><br>
</div>
<div>So I am thinking in doing this in my production
server but I would like to know if there is any
potential risk of doing this (as I am not sure why it
was decided for these fields to be varchar instead of
a numeric type).<br>
</div>
<div><br>
</div>
<div>Regards,</div>
<div>Takeshi</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
<br>
<fieldset></fieldset>
<br>
</div></div><pre>_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a>
<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><span class="HOEnZb"><font color="#888888">
</font></span></pre><span class="HOEnZb"><font color="#888888">
</font></span></blockquote><span class="HOEnZb"><font color="#888888">
<br>
<pre cols="72">--
Daniel-Constantin Mierla
<a href="http://twitter.com/#!/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a>
Book: SIP Routing With Kamailio - <a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a></pre>
</font></span></div>
<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" rel="noreferrer" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br></blockquote></div><br></div></div></div>