[Rt-commit] rt branch 5.0/ocfv-sort-order-index created. rt-5.0.4-18-ga2af4c380c

BPS Git Server git at git.bestpractical.com
Mon May 22 20:51:37 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/ocfv-sort-order-index has been created
        at  a2af4c380c0c2278924148625bcf854d76281499 (commit)

- Log -----------------------------------------------------------------
commit a2af4c380c0c2278924148625bcf854d76281499
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue May 23 04:35:16 2023 +0800

    Index SortOrder of ObjectCustomFieldValues
    
    As SortOrder is one of the default order columns, indexing it can
    improve search performance, especially when you loop through a bunch of
    rows.

diff --git a/etc/schema.Oracle b/etc/schema.Oracle
index f0f783f80d..a9a8a854ea 100644
--- a/etc/schema.Oracle
+++ b/etc/schema.Oracle
@@ -344,6 +344,7 @@ CREATE TABLE ObjectCustomFieldValues (
 
 CREATE INDEX ObjectCustomFieldValues1 ON ObjectCustomFieldValues (Content); 
 CREATE INDEX ObjectCustomFieldValues2 ON ObjectCustomFieldValues (CustomField,ObjectType,ObjectId); 
+CREATE INDEX ObjectCustomFieldValues3 ON ObjectCustomFieldValues (SortOrder);
 
 CREATE SEQUENCE CUSTOMFIELDS_seq;
 CREATE TABLE CustomFields (
diff --git a/etc/schema.Pg b/etc/schema.Pg
index 9ab84bba1c..40afa1e317 100644
--- a/etc/schema.Pg
+++ b/etc/schema.Pg
@@ -516,6 +516,7 @@ CREATE TABLE ObjectCustomFieldValues (
 
 CREATE INDEX ObjectCustomFieldValues1 ON ObjectCustomFieldValues (CustomField,ObjectType,ObjectId,Content); 
 CREATE INDEX ObjectCustomFieldValues2 ON ObjectCustomFieldValues (CustomField,ObjectType,ObjectId); 
+CREATE INDEX ObjectCustomFieldValues3 ON ObjectCustomFieldValues (SortOrder);
 
 
 
diff --git a/etc/schema.SQLite b/etc/schema.SQLite
index cdafced4f8..934cd82607 100644
--- a/etc/schema.SQLite
+++ b/etc/schema.SQLite
@@ -372,6 +372,7 @@ CREATE TABLE ObjectCustomFieldValues (
 
 CREATE INDEX ObjectCustomFieldValues1 ON ObjectCustomFieldValues (Content); 
 CREATE INDEX ObjectCustomFieldValues2 ON ObjectCustomFieldValues (CustomField,ObjectType,ObjectId); 
+CREATE INDEX ObjectCustomFieldValues3 ON ObjectCustomFieldValues (SortOrder);
 
 
 
diff --git a/etc/schema.mysql b/etc/schema.mysql
index 5a359e5e9d..ea3c7fb1ee 100644
--- a/etc/schema.mysql
+++ b/etc/schema.mysql
@@ -344,6 +344,7 @@ CREATE TABLE ObjectCustomFieldValues (
 
 CREATE INDEX ObjectCustomFieldValues1 ON ObjectCustomFieldValues (Content);
 CREATE INDEX ObjectCustomFieldValues2 ON ObjectCustomFieldValues (CustomField,ObjectType,ObjectId);
+CREATE INDEX ObjectCustomFieldValues3 ON ObjectCustomFieldValues (SortOrder);
 
 
 
diff --git a/etc/upgrade/5.0.5/indexes b/etc/upgrade/5.0.5/indexes
new file mode 100644
index 0000000000..efbbb8c1e3
--- /dev/null
+++ b/etc/upgrade/5.0.5/indexes
@@ -0,0 +1,9 @@
+use strict;
+use warnings;
+
+$RT::Handle->MakeSureIndexExists(
+    Table => 'ObjectCustomFieldValues',
+    Columns => ['SortOrder'],
+);
+
+1;

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


hooks/post-receive
-- 
rt


More information about the rt-commit mailing list