Browse code

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.

Alessio Garzi authored on 14/07/2022 07:53:23 • Henning Westerholt committed on 21/07/2022 14:07:39
Showing 1 changed files
... ...
@@ -63,7 +63,7 @@
63 63
         <natural/>
64 64
     </column>
65 65
 
66
-    <column>
66
+    <column id="status">
67 67
         <name>status</name>
68 68
         <type>int</type>
69 69
         <size>11</size>
... ...
@@ -78,7 +78,7 @@
78 78
         <description>Reason</description>
79 79
     </column>
80 80
 
81
-    <column>
81
+    <column id="inserted_time">
82 82
         <name>inserted_time</name>
83 83
         <type>int</type>
84 84
         <size>11</size>
... ...
@@ -93,4 +93,10 @@
93 93
         <unique/>
94 94
     </index>
95 95
 
96
+    <index>
97
+        <name>time_status_idx</name>
98
+        <colref linkend="inserted_time"/>
99
+        <colref linkend="status"/>
100
+    </index>
101
+
96 102
 </table>