Commit ccac566d authored by Kevin Falcone's avatar Kevin Falcone
Browse files

Merge branch '3.0/2.9.0-upgrade-performance' into 3.0-trunk

parents c5bcfe5b 63045f16
......@@ -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
......
......@@ -151,7 +151,7 @@ our @Final = (
}
},
# in RTIR queues for variouse reasons we kept Status and State in
# in RTIR queues for various reasons we kept Status and State in
# sync with each other and were hiding these txns in the UI. Now
# we delete old status changes
# and convert State changes into Status changes
......@@ -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();
......@@ -203,6 +204,7 @@ our @Final = (
$txns->Limit( ALIAS => $ocfv_alias, FIELD => 'Content', VALUE => $state );
$txns->Limit( ALIAS => $ocfv_alias, FIELD => 'CustomField', VALUE => $cf->id );
$txns->Columns('id');
$txns->OrderBy;
my $res = $RT::Handle->SimpleUpdateFromSelect(
'Transactions', { $old_new .'Value' => $state }, $txns->BuildSelectQuery
......@@ -230,6 +232,7 @@ our @Final = (
VALUE => 'NULL'
);
$txns->Columns( $old_new .'Reference' );
$txns->OrderBy;
my $res = $RT::Handle->DeleteFromSelect(
'ObjectCustomFieldValues', $txns->BuildSelectQuery
......@@ -268,6 +271,7 @@ our @Final = (
$txns->Limit( FIELD => 'Type', VALUE => 'CustomField' );
$txns->Limit( FIELD => 'Field', VALUE => $cf->id );
$txns->Columns('id');
$txns->OrderBy();
my $res = $RT::Handle->SimpleUpdateFromSelect(
'Transactions',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment