[OpenSIPS-Devel] Location table structure - account_contact_idx

Liviu Chircu liviu at opensips.org
Wed Oct 2 05:28:19 EDT 2019


On 02.10.2019 12:12, Donat Zenichev wrote:
> modparam("usrloc", "working_mode_preset", "sql-only")
Is there a special reason why you are using "sql-only"?  We've only 
carried it to 2.4
just to make the transition easier.  But, in my opinion, 
"single-instance-sql-write-through"
is net superior, since:

* the WRITE operations (REGISTER processing) are just as slow as with 
"sql-only", since both
   modes wait for the WRITE to finish before replying to the UAC, thus 
guaranteeing the registration
   cannot be lost anymore

* the READ operations (INVITE processing) are much faster than 
"sql-only", as the data is cached

Aside from these design considerations, I see no issues with creating 
that unique index.  To help
you a bit, the actual SELECT query only fetches the "username" + 
"domain" columns.  So I think your
composite index covers that and optimizes the lookup.

Cheers,

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com

> I also have one last question, is it a bad practice to include indexes 
> (unique/constraint keys) into OpenSIPS table structures?
> Such as I did with a location table (of OpenSIPS 2.4 version):
> "UNIQUE KEY `account_contact_idx` 
> (`username`,`domain`,`contact`,`callid`,`contact_id`)"
>
> Would this have any superfluous impact on the system?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/devel/attachments/20191002/8283d3de/attachment.html>


More information about the Devel mailing list