[Rt-commit] rt branch 5.0/change-indexes-on-links-table created. rt-5.0.4-18-gc0aa1401c4

BPS Git Server git at git.bestpractical.com
Mon May 22 20:40:42 UTC 2023


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt".

The branch, 5.0/change-indexes-on-links-table has been created
        at  c0aa1401c455c3dd29f547eb9d8246c6df0e3a8e (commit)

- Log -----------------------------------------------------------------
commit c0aa1401c455c3dd29f547eb9d8246c6df0e3a8e
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Mon May 22 23:29:07 2023 +0300

    Add inndexes (Local{Base, Target}, Type) instead of Links4
    
    Indexes starting from Local* columns are more selective.
    
    There were no index starting from LocalTarget. Now if you know
    local target ID then search would be very fast.
    
    Index starting from Type or having only Type column doesn't seems
    to be very selective and required.

diff --git a/etc/schema.Oracle b/etc/schema.Oracle
index f0f783f80d..c40897ecb5 100644
--- a/etc/schema.Oracle
+++ b/etc/schema.Oracle
@@ -59,7 +59,8 @@ CREATE TABLE Links (
 CREATE UNIQUE INDEX Links1 ON Links (Base, Target, Type);
 CREATE INDEX Links2 ON Links (Base, Type);
 CREATE INDEX Links3 ON Links (Target, Type);
-CREATE INDEX Links4 ON Links(Type,LocalBase);
+CREATE INDEX Links5 ON Links (LocalBase, Type);
+CREATE INDEX Links6 ON Links (LocalTarget, Type);
 
 
 CREATE SEQUENCE PRINCIPALS_seq;
diff --git a/etc/schema.Pg b/etc/schema.Pg
index 9ab84bba1c..ea5863e3c8 100644
--- a/etc/schema.Pg
+++ b/etc/schema.Pg
@@ -92,7 +92,8 @@ CREATE TABLE Links (
 
 );
 CREATE UNIQUE INDEX Links1 ON Links (Base, Target, Type) ;
-CREATE INDEX Links4 ON Links(Type,LocalBase);
+CREATE INDEX Links5 ON Links (LocalBase, Type);
+CREATE INDEX Links6 ON Links (LocalTarget, Type);
 
 
 
diff --git a/etc/schema.SQLite b/etc/schema.SQLite
index cdafced4f8..42fb40397c 100644
--- a/etc/schema.SQLite
+++ b/etc/schema.SQLite
@@ -60,7 +60,8 @@ CREATE TABLE Links (
   
 ) ;
 CREATE UNIQUE INDEX Links1 ON Links (Base, Target, Type) ;
-CREATE INDEX Links4 ON Links(Type,LocalBase);
+CREATE INDEX Links5 ON Links(LocalBase, Type);
+CREATE INDEX Links6 ON Links(LocalTarget, Type);
 
 --- }}}
 
diff --git a/etc/schema.mysql b/etc/schema.mysql
index 5a359e5e9d..efdb95fe4d 100644
--- a/etc/schema.mysql
+++ b/etc/schema.mysql
@@ -58,7 +58,8 @@ CREATE TABLE Links (
 
 CREATE INDEX Links2 ON Links (Base,  Type) ;
 CREATE INDEX Links3 ON Links (Target,  Type) ;
-CREATE INDEX Links4 ON Links (Type,LocalBase);
+CREATE INDEX Links5 ON Links (LocalBase, Type);
+CREATE INDEX Links6 ON Links (LocalTarget, Type);
 
 
 
diff --git a/etc/upgrade/5.0.5/schema.Oracle b/etc/upgrade/5.0.5/schema.Oracle
new file mode 100644
index 0000000000..264e3b91fe
--- /dev/null
+++ b/etc/upgrade/5.0.5/schema.Oracle
@@ -0,0 +1,4 @@
+DROP INDEX IF EXISTS Links4;
+
+CREATE INDEX Links5 ON Links (LocalBase, Type);
+CREATE INDEX Links6 ON Links (LocalTarget, Type);
\ No newline at end of file
diff --git a/etc/upgrade/5.0.5/schema.Pg b/etc/upgrade/5.0.5/schema.Pg
new file mode 100644
index 0000000000..264e3b91fe
--- /dev/null
+++ b/etc/upgrade/5.0.5/schema.Pg
@@ -0,0 +1,4 @@
+DROP INDEX IF EXISTS Links4;
+
+CREATE INDEX Links5 ON Links (LocalBase, Type);
+CREATE INDEX Links6 ON Links (LocalTarget, Type);
\ No newline at end of file
diff --git a/etc/upgrade/5.0.5/schema.SQLite b/etc/upgrade/5.0.5/schema.SQLite
new file mode 100644
index 0000000000..264e3b91fe
--- /dev/null
+++ b/etc/upgrade/5.0.5/schema.SQLite
@@ -0,0 +1,4 @@
+DROP INDEX IF EXISTS Links4;
+
+CREATE INDEX Links5 ON Links (LocalBase, Type);
+CREATE INDEX Links6 ON Links (LocalTarget, Type);
\ No newline at end of file
diff --git a/etc/upgrade/5.0.5/schema.mysql b/etc/upgrade/5.0.5/schema.mysql
new file mode 100644
index 0000000000..264e3b91fe
--- /dev/null
+++ b/etc/upgrade/5.0.5/schema.mysql
@@ -0,0 +1,4 @@
+DROP INDEX IF EXISTS Links4;
+
+CREATE INDEX Links5 ON Links (LocalBase, Type);
+CREATE INDEX Links6 ON Links (LocalTarget, Type);
\ No newline at end of file

-----------------------------------------------------------------------


hooks/post-receive
-- 
rt


More information about the rt-commit mailing list