<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 02.10.2019 12:12, Donat Zenichev
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CANLwQCmb=Lo5iriPiWmSniLx4VVWPmawPM-aUv+RT+fYb-XZZw@mail.gmail.com">
      <div><span id="gmail-LC86" class="gmail-line" lang="plaintext">modparam("usrloc",
          "working_mode_preset", "sql-only")</span></div>
    </blockquote>
    <tt>Is there a special reason why you are using "sql-only"?  We've
      only carried it to 2.4<br>
      just to make the transition easier.  But, in my opin</tt><tt>ion,
      "single-instance-sql-write-through"<br>
      is net superior, since:<br>
      <br>
    </tt>
    <p><tt>* the WRITE operations (REGISTER processing) are just as slow
        as with "sql-only", since both<br>
          modes wait for the WRITE to finish before replying to the UAC,
        thus guaranteeing the registration<br>
          cannot be lost anymore<br>
        <br>
        * the READ operations (INVITE processing) are much faster than
        "sql-only", as the data is cached<br>
        <br>
        Aside from these design considerations, I see no issues with
        creating that unique index.  To help<br>
        you a bit, the actual SELECT query only fetches the "username" +
        "domain" columns.  So I think your<br>
        composite index covers that and optimizes the lookup.</tt></p>
    <p><tt>Cheers,</tt></p>
    <pre class="moz-signature" cols="72">Liviu Chircu
OpenSIPS Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
    <blockquote type="cite"
cite="mid:CANLwQCmb=Lo5iriPiWmSniLx4VVWPmawPM-aUv+RT+fYb-XZZw@mail.gmail.com">
      <div><span id="gmail-LC92" class="gmail-line" lang="plaintext">I
          also have one last question, is it a bad practice to include
          indexes (unique/constraint keys) into OpenSIPS table
          structures?</span></div>
      <div><span id="gmail-LC92" class="gmail-line" lang="plaintext">Such
          as I did with a location table (of OpenSIPS 2.4 version):</span></div>
      <div><span id="gmail-LC92" class="gmail-line" lang="plaintext">"UNIQUE
          KEY `account_contact_idx`
          (`username`,`domain`,`contact`,`callid`,`contact_id`)"</span></div>
      <div><span id="gmail-LC92" class="gmail-line" lang="plaintext"><br>
        </span></div>
      <div><span id="gmail-LC92" class="gmail-line" lang="plaintext">Would
          this have any superfluous impact on the system?</span></div>
    </blockquote>
  </body>
</html>