Prechádzať zdrojové kódy

adding two more indexes to acc table

Karel Kozlik 17 rokov pred
rodič
commit
ef5eee7921

+ 13 - 3
db/schema/acc.xml

@@ -29,7 +29,7 @@
 	    of a subscriber. 
 	</db:para>
     </description>
-    <version>3</version>
+    <version>4</version>
 
     <column id="acc.id">
 	<name>id</name>
@@ -44,7 +44,7 @@
 	</description>
     </column>
 
-    <column>
+    <column id="acc.from_uid">
 	<name>from_uid</name>
 	<type>string</type>
 	<size>&id_len;</size>
@@ -56,7 +56,7 @@
 	    no uid assigned on the server).
 	</description>
     </column>
-    <column>
+    <column id="acc.to_uid">
 	<name>to_uid</name>
 	<type>string</type>
 	<size>&id_len;</size>
@@ -454,4 +454,14 @@
 	<name>acc_cid_key</name>
 	<colref linkend="acc.sip_callid"/>
     </index>
+    
+    <index role="serweb">
+	<name>acc_from_uid</name>
+	<colref linkend="acc.from_uid"/>
+    </index>
+    
+    <index role="serweb">
+	<name>acc_to_uid</name>
+	<colref linkend="acc.to_uid"/>
+    </index>
 </table>

+ 4 - 2
scripts/mysql/my_create.sql

@@ -3,7 +3,7 @@ CREATE TABLE version (
     table_version INT UNSIGNED NOT NULL DEFAULT '0'
 );
 
-INSERT INTO version (table_name, table_version) values ('acc','3');
+INSERT INTO version (table_name, table_version) values ('acc','4');
 CREATE TABLE acc (
     id INT AUTO_INCREMENT NOT NULL,
     from_uid VARCHAR(64),
@@ -31,7 +31,9 @@ CREATE TABLE acc (
     flags INT UNSIGNED NOT NULL DEFAULT '0',
     attrs VARCHAR(255),
     UNIQUE KEY acc_id_key (id),
-    KEY acc_cid_key (sip_callid)
+    KEY acc_cid_key (sip_callid),
+    KEY acc_from_uid (from_uid),
+    KEY acc_to_uid (to_uid)
 );
 
 INSERT INTO version (table_name, table_version) values ('missed_calls','3');

+ 4 - 2
scripts/oracle/or_create.sql

@@ -3,7 +3,7 @@ CREATE TABLE version (
     table_version INT UNSIGNED NOT NULL DEFAULT '0'
 );
 
-INSERT INTO version (table_name, table_version) values ('acc','3');
+INSERT INTO version (table_name, table_version) values ('acc','4');
 CREATE TABLE acc (
     id INT NOT NULL,
     from_uid VARCHAR(64),
@@ -31,7 +31,9 @@ CREATE TABLE acc (
     flags INT UNSIGNED NOT NULL DEFAULT '0',
     attrs VARCHAR(255),
     UNIQUE KEY acc_id_key (id),
-    KEY acc_cid_key (sip_callid)
+    KEY acc_cid_key (sip_callid),
+    KEY acc_from_uid (from_uid),
+    KEY acc_to_uid (to_uid)
 );
 
 INSERT INTO version (table_name, table_version) values ('missed_calls','3');

+ 3 - 1
scripts/postgres/pg_create.sql

@@ -4,7 +4,7 @@ CREATE TABLE version (
     table_version INTEGER NOT NULL DEFAULT '0'
 );
 
-INSERT INTO version (table_name, table_version) values ('acc','3');
+INSERT INTO version (table_name, table_version) values ('acc','4');
 CREATE TABLE acc (
     id SERIAL NOT NULL,
     from_uid VARCHAR(64),
@@ -35,6 +35,8 @@ CREATE TABLE acc (
 );
 
 CREATE INDEX acc_cid_key ON acc (sip_callid);
+CREATE INDEX acc_from_uid ON acc (from_uid);
+CREATE INDEX acc_to_uid ON acc (to_uid);
 
 INSERT INTO version (table_name, table_version) values ('missed_calls','3');
 CREATE TABLE missed_calls (