[Rt-commit] rt branch, 4.4/attachment-filename-index, created. rt-4.4.1-215-g40d89e3

Shawn Moore shawn at bestpractical.com
Fri Dec 30 16:29:21 EST 2016


The branch, 4.4/attachment-filename-index has been created
        at  40d89e32017ed1a8ee5fca995c79121180cb60ba (commit)

- Log -----------------------------------------------------------------
commit 40d89e32017ed1a8ee5fca995c79121180cb60ba
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Fri Dec 30 21:26:04 2016 +0000

    Add index on Attachments table column Filename
    
    The search builder offers it as a search criterion, so it should be
    well-indexed
    
    Fixes: I#32033

diff --git a/etc/schema.Oracle b/etc/schema.Oracle
index afa2c94..b3e677b 100644
--- a/etc/schema.Oracle
+++ b/etc/schema.Oracle
@@ -17,6 +17,7 @@ CREATE TABLE Attachments (
 );
 CREATE INDEX Attachments2 ON Attachments (TransactionId);
 CREATE INDEX Attachments3 ON Attachments (Parent, TransactionId);
+CREATE INDEX Attachments4 ON Attachments (Filename);
 
 
 CREATE SEQUENCE QUEUES_seq;
diff --git a/etc/schema.Pg b/etc/schema.Pg
index c758284..aa4b437 100644
--- a/etc/schema.Pg
+++ b/etc/schema.Pg
@@ -33,6 +33,7 @@ CREATE TABLE Attachments (
 CREATE INDEX Attachments1 ON Attachments (Parent) ;
 CREATE INDEX Attachments2 ON Attachments (TransactionId) ;
 CREATE INDEX Attachments3 ON Attachments (Parent, TransactionId) ;
+CREATE INDEX Attachments4 ON Attachments (Filename) ;
 
 
 
diff --git a/etc/schema.SQLite b/etc/schema.SQLite
index 3288a57..f8e6ae9 100644
--- a/etc/schema.SQLite
+++ b/etc/schema.SQLite
@@ -19,6 +19,7 @@ CREATE TABLE Attachments (
 CREATE INDEX Attachments1 ON Attachments (Parent) ;
 CREATE INDEX Attachments2 ON Attachments (TransactionId) ;
 CREATE INDEX Attachments3 ON Attachments (Parent, TransactionId) ;
+CREATE INDEX Attachments4 ON Attachments (Filename) ;
 --- }}}
 
 --- {{{ Queues
diff --git a/etc/schema.mysql b/etc/schema.mysql
index 4baf28d..eefc145 100644
--- a/etc/schema.mysql
+++ b/etc/schema.mysql
@@ -17,6 +17,7 @@ CREATE TABLE Attachments (
 
 CREATE INDEX Attachments2 ON Attachments (TransactionId) ;
 CREATE INDEX Attachments3 ON Attachments (Parent, TransactionId) ;
+CREATE INDEX Attachments4 ON Attachments (Filename) ;
 
 CREATE TABLE Queues (
   id INTEGER NOT NULL  AUTO_INCREMENT,
diff --git a/etc/upgrade/4.4.2/indexes b/etc/upgrade/4.4.2/indexes
new file mode 100644
index 0000000..777ae88
--- /dev/null
+++ b/etc/upgrade/4.4.2/indexes
@@ -0,0 +1,9 @@
+use strict;
+use warnings;
+
+$RT::Handle->MakeSureIndexExists(
+    Table => 'Attachments',
+    Columns => ['Filename'],
+);
+        
+1;  

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


More information about the rt-commit mailing list