Browse code

Merge ecfbea23c8b19d28e56e7809e3ef09cd5b101729 into e21df35840c7a85cf26a3005f718e5e37edeac8e

Alessio Garzi authored on 18/07/2022 07:45:34 • GitHub committed on 18/07/2022 07:45:34
Showing 5 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>
... ...
@@ -69,6 +69,8 @@ CREATE TABLE watchers (
69 69
     CONSTRAINT watchers_watcher_idx UNIQUE (presentity_uri, watcher_username, watcher_domain, event)
70 70
 );
71 71
 
72
+CREATE INDEX watchers_time_status_idx ON watchers (inserted_time, status);
73
+
72 74
 INSERT INTO version (table_name, table_version) values ('watchers','3');
73 75
 
74 76
 CREATE TABLE xcap (
... ...
@@ -69,6 +69,8 @@ CREATE TABLE `watchers` (
69 69
     CONSTRAINT watcher_idx UNIQUE (`presentity_uri`, `watcher_username`, `watcher_domain`, `event`)
70 70
 );
71 71
 
72
+CREATE INDEX time_status_idx ON watchers (`inserted_time`, `status`);
73
+
72 74
 INSERT INTO version (table_name, table_version) values ('watchers','3');
73 75
 
74 76
 CREATE TABLE `xcap` (
... ...
@@ -93,6 +93,8 @@ END watchers_tr;
93 93
 /
94 94
 BEGIN map2users('watchers'); END;
95 95
 /
96
+CREATE INDEX watchers_time_status_idx  ON watchers (inserted_time, status);
97
+
96 98
 INSERT INTO version (table_name, table_version) values ('watchers','3');
97 99
 
98 100
 CREATE TABLE xcap (
... ...
@@ -69,6 +69,8 @@ CREATE TABLE watchers (
69 69
     CONSTRAINT watchers_watcher_idx UNIQUE (presentity_uri, watcher_username, watcher_domain, event)
70 70
 );
71 71
 
72
+CREATE INDEX watchers_time_status_idx ON watchers (inserted_time, status);
73
+
72 74
 INSERT INTO version (table_name, table_version) values ('watchers','3');
73 75
 
74 76
 CREATE TABLE xcap (