Module: kamailio
Branch: master
Commit: 3e916b2ddf8a2a4a4db5ecbf6e64f7e4e23dc246
URL:
https://github.com/kamailio/kamailio/commit/3e916b2ddf8a2a4a4db5ecbf6e64f7e…
Author: Alessio Garzi <agarzi(a)sipwise.com>
Committer: Henning Westerholt <hw(a)gilawa.com>
Date: 2022-07-21T16:07:39+02:00
lib/srdb1: Index "inserted_time"+"status" in watchers
- New index for watchers table for columns "inserted_time" and
"status".
This is a little performance boost since the function
ps_watchers_db_timer_clean() cleans pending subscriptions
using this columns inside the "where" clause.
New index has been added to both Postgres and Mysql/MariaDB backends.
---
Modified: src/lib/srdb1/schema/pr_watchers.xml
---
Diff:
https://github.com/kamailio/kamailio/commit/3e916b2ddf8a2a4a4db5ecbf6e64f7e…
Patch:
https://github.com/kamailio/kamailio/commit/3e916b2ddf8a2a4a4db5ecbf6e64f7e…
---
diff --git a/src/lib/srdb1/schema/pr_watchers.xml b/src/lib/srdb1/schema/pr_watchers.xml
index e5bdbffa404..919cf42a0f6 100644
--- a/src/lib/srdb1/schema/pr_watchers.xml
+++ b/src/lib/srdb1/schema/pr_watchers.xml
@@ -63,7 +63,7 @@
<natural/>
</column>
- <column>
+ <column id="status">
<name>status</name>
<type>int</type>
<size>11</size>
@@ -78,7 +78,7 @@
<description>Reason</description>
</column>
- <column>
+ <column id="inserted_time">
<name>inserted_time</name>
<type>int</type>
<size>11</size>
@@ -93,4 +93,10 @@
<unique/>
</index>
+ <index>
+ <name>time_status_idx</name>
+ <colref linkend="inserted_time"/>
+ <colref linkend="status"/>
+ </index>
+
</table>