[Rt-commit] [rtir] 02/03: Improve our Dependent Subclause

Kevin Falcone falcone at bestpractical.com
Fri Nov 22 19:38:08 EST 2013


This is an automated email from the git hooks/post-receive script.

falcone pushed a commit to branch 3.0/2.9.0-upgrade-performance
in repository rtir.

commit 3d212688ff232cc24ee7671a3d65e804ad52a18c
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Fri Nov 22 16:10:57 2013 -0500

    Improve our Dependent Subclause
    
    When MySQL optimizes our UPDATE where id in (SELECT) it doesn't know
    that the tables are linked, so it ends up walking and examining lots and
    lots of rows.  Including the ObjectType column means that mysql can
    easily examine 1 row using our existing ObjectCustomFieldValues2 index
    and update immediately.
    
    There is no longer a need to add upgrade specific indexes for OCFVs (the
    transaction indexes still improve performance).
---
 docs/UPGRADING-3.0        | 2 --
 etc/upgrade/2.9.0/content | 1 +
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/docs/UPGRADING-3.0 b/docs/UPGRADING-3.0
index a89568f..145e2c9 100644
--- a/docs/UPGRADING-3.0
+++ b/docs/UPGRADING-3.0
@@ -19,7 +19,6 @@ improve the performance of the upgrade.
     CREATE INDEX UPGRADE_TRANSACTIONS_TYPE ON Transactions (Type, Field);
     CREATE INDEX UPGRADE_TRANSACTIONS_NEW ON Transactions(Field,ObjectType, Type, NewReference);
     CREATE INDEX UPGRADE_TRANSACTIONS_OLD on Transactions(Field,ObjectType, Type, OldReference);
-    CREATE INDEX UPGRADE_OCFV_STATUS ON ObjectCustomFieldValues(Content,Disabled,CustomField);
 
 These should be removed following a successful since they are unlikely
 to be useful in normal RTIR usage.
@@ -27,7 +26,6 @@ to be useful in normal RTIR usage.
     DROP INDEX UPGRADE_TRANSACTIONS_TYPE ON Transactions;
     DROP INDEX UPGRADE_TRANSACTIONS_NEW ON Transactions;
     DROP INDEX UPGRADE_TRANSACTIONS_OLD ON Transactions;
-    DROP INDEX UPGRADE_OCFV_STATUS ON ObjectCustomFieldValues;
 
 =head2 Lifecycles
 
diff --git a/etc/upgrade/2.9.0/content b/etc/upgrade/2.9.0/content
index c89e16b..6f8d906 100644
--- a/etc/upgrade/2.9.0/content
+++ b/etc/upgrade/2.9.0/content
@@ -169,6 +169,7 @@ our @Final = (
                 $values->Limit( FIELD => 'CustomField', VALUE => $cf->id );
                 $values->Limit( FIELD => 'Disabled', VALUE => 0 );
                 $values->Limit( FIELD => 'Content', VALUE => $state );
+                $values->Limit( FIELD => 'ObjectType', VALUE => 'RT::Ticket' );
                 $values->Columns('ObjectId');
                 $values->OrderBy();
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the rt-commit mailing list