Explorar o código

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 %!s(int64=3) %!d(string=hai) anos
pai
achega
3e916b2ddf
Modificáronse 1 ficheiros con 8 adicións e 2 borrados
  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>