Преглед изворни кода

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 пре 3 година
родитељ
комит
3e916b2ddf
1 измењених фајлова са 8 додато и 2 уклоњено
  1. 8 2
      src/lib/srdb1/schema/pr_watchers.xml

+ 8 - 2
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>