-- SQL Server indexes for version 3-402 -- After this they should be added by changes.xml or in the installer Create Index [IX_Relationship1] ON [AssetAttributeValue] ([AssetId]) go Create Index [IX_Relationship6] ON [AssetBoxAsset] ([AssetId]) go Create Index [IX_Relationship8] ON [CM_ItemInCategory] ([ItemId]) go Create Index [IX_Relationship29] ON [ImageAsset] ([AssetId]) go Create Index [IX_Relationship39] ON [AttributeValue] ([AssetId]) go Create Index [IX_Relationship49] ON [AssetUse] ([AssetId]) go Create Index [IX_Relationship66] ON [AssetApproval] ([AssetId]) go Create Index [IX_Relationship77] ON [AssetView] ([AssetId]) go Create Index [IX_Relationship95] ON [RelatedAsset] ([ParentId]) go Create Index [IX_Relationship96] ON [RelatedAsset] ([ChildId]) go Create Index [IX_Relationship104] ON [PromotedAsset] ([AssetId]) go Create Index [IX_Relationship123] ON [VideoAsset] ([AssetId]) go Create Index [IX_Relationship127] ON [FeaturedAsset] ([AssetId]) go Create Index [IX_Relationship135] ON [AssetBoxPriceBand] ([AssetId]) go Create Index [IX_Relationship150] ON [FeaturedAssetInBrand] ([AssetId]) go Create Index [IX_Relationship151] ON [AudioAsset] ([AssetId]) go Create Index [IX_Relationship214] ON [AssetInMarketingEmail] ([AssetId]) go Create Index [IX_Relationship219] ON [Asset] ([CurrentVersionId]) go Create Index [IX_Relationship241] ON [AssetChangeLog] ([AssetId]) go Create Index [IX_Relationship263] ON [RepurposedAsset] ([AssetId]) go Create Index [IX_Relationship273] ON [AssetAgreement] ([AssetId]) go Create Index [IX_Relationship278] ON [AssetRating] ([AssetId]) go Create Index [IX_Relationship282] ON [AssetWorkflowAudit] ([AssetId]) go Create Index [IX_Relationship5] ON [AssetBoxAsset] ([AssetBoxId]) go Create Index [IX_Relationship134] ON [AssetBoxPriceBand] ([AssetBoxId]) go Create Index [IX_Relationship158] ON [AssetBoxShare] ([AssetBoxId]) go Create Index [IX_Relationship22] ON [Asset] ([AddedByUserId]) go Create Index [IX_Relationship47] ON [UserInGroup] ([UserId]) go Create Index [IX_Relationship51] ON [AssetUse] ([UserId]) go Create Index [IX_Relationship52] ON [AssetBox] ([UserId]) go Create Index [IX_Relationship63] ON [AssetView] ([UserId]) go Create Index [IX_Relationship67] ON [AssetApproval] ([UserId]) go Create Index [IX_Relationship69] ON [Asset] ([LastModifiedByUserId]) go Create Index [IX_Relationship78] ON [ABOrder] ([UserId]) go Create Index [IX_Relationship120] ON [Subscription] ([UserId]) go Create Index [IX_Relationship159] ON [AssetBoxShare] ([UserId]) go Create Index [IX_Relationship164] ON [AssetBoxAsset] ([AddedByUserId]) go Create Index [IX_Relationship172] ON [UserInMarketingGroup] ([UserId]) go Create Index [IX_Relationship187] ON [AssetBankUser] ([LastModifiedById]) go Create Index [IX_Relationship195] ON [SavedSearch] ([UserId]) go Create Index [IX_Relationship243] ON [SessionLog] ([UserId]) go Create Index [IX_Relationship259] ON [Filter] ([UserId]) go Create Index [IX_Relationship264] ON [RepurposedAsset] ([CreatedByUserId]) go Create Index [IX_Relationship279] ON [AssetRating] ([UserId]) go Create Index [IX_Relationship284] ON [AssetWorkflowAudit] ([UserId]) go Create Index [IX_Relationship285] ON [AssetBankUser] ([InvitedByUserId]) go Create Index [IX_Relationship9] ON [CM_ItemInCategory] ([CategoryId]) go Create Index [IX_Relationship10] ON [CM_Category] ([ParentId]) go Create Index [IX_Relationship35] ON [CategoryVisibleToGroup] ([CategoryId]) go Create Index [IX_Relationship76] ON [OrgUnit] ([RootOrgUnitCategoryId]) go Create Index [IX_Relationship177] ON [TranslatedCategory] ([CategoryId]) go Create Index [IX_Relationship290] ON [FilterForCategory] ([CategoryId]) go Create Index [IX_Relationship2] ON [AssetAttributeValue] ([AttributeValueId]) go Create Index [IX_Relationship169] ON [FilterAttributeValue] ([AttributeValueId]) go Create Index [IX_Relationship176] ON [TranslatedAttributeValue] ([AttributeValueId]) go Create Index [IX_Relationship4] ON [AttributeValue] ([AttributeId]) go Create Index [IX_Relationship40] ON [GroupAttributeExclusion] ([AttributeId]) go Create Index [IX_Relationship45] ON [AttributeVisibleToGroup] ([AttributeId]) go Create Index [IX_Relationship46] ON [AssetAttributeValue] ([AttributeId]) go Create Index [IX_Relationship86] ON [ChangeAttributeValueDateRule] ([ChangeAttributeId]) go Create Index [IX_Relationship89] ON [ChangeAttributeValueDateRule] ([AttributeId]) go Create Index [IX_Relationship90] ON [SendEmailDateRule] ([AttributeId]) go Create Index [IX_Relationship126] ON [SortAttribute] ([AttributeId]) go Create Index [IX_Relationship157] ON [DisplayAttribute] ([AttributeId]) go Create Index [IX_Relationship163] ON [EmbeddedDataMapping] ([AttributeId]) go Create Index [IX_Relationship173] ON [TranslatedAttribute] ([AttributeId]) go Create Index [IX_Relationship253] ON [AssetEntityAttribute] ([AttributeId]) go Create Index [IX_Relationship7] ON [CM_Category] ([CategoryTypeId]) go Create Index [IX_Relationship34] ON [CategoryVisibleToGroup] ([UserGroupId]) go Create Index [IX_Relationship41] ON [GroupAttributeExclusion] ([UserGroupId]) go Create Index [IX_Relationship44] ON [AttributeVisibleToGroup] ([UserGroupId]) go Create Index [IX_Relationship48] ON [UserInGroup] ([UserGroupId]) go Create Index [IX_Relationship73] ON [OrgUnit] ([AdminGroupId]) go Create Index [IX_Relationship75] ON [OrgUnitGroup] ([UserGroupId]) go Create Index [IX_Relationship81] ON [OrgUnit] ([StandardGroupId]) go Create Index [IX_Relationship88] ON [GroupEmailRule] ([UserGroupId]) go Create Index [IX_Relationship100] ON [GroupUsageExclusion] ([UserGroupId]) go Create Index [IX_Relationship108] ON [GroupInSubscriptionModel] ([UserGroupId]) go Create Index [IX_Relationship154] ON [GroupIsRole] ([UserGroupId]) go Create Index [IX_Relationship167] ON [ScheduledReportGroup] ([GroupId]) go Create Index [IX_Relationship288] ON [GroupFilterExclusion] ([UserGroupId]) go Create Index [IX_Relationship19] ON [Attribute] ([AttributeTypeId]) go Create Index [IX_Relationship27] ON [Asset] ([AssetTypeId]) go Create Index [IX_Relationship58] ON [FileFormat] ([AssetTypeId]) go Create Index [IX_Relationship153] ON [UsageType] ([AssetTypeId]) go Create Index [IX_Relationship223] ON [PriceBand] ([AssetTypeId]) go Create Index [IX_Relationship254] ON [AllowableEntityAssetType] ([AssetTypeId]) go Create Index [IX_Relationship50] ON [AssetUse] ([UsageTypeId]) go Create Index [IX_Relationship70] ON [AssetApproval] ([UsageTypeId]) go Create Index [IX_Relationship82] ON [UsageTypeFormat] ([UsageTypeId]) go Create Index [IX_Relationship97] ON [UsageType] ([ParentId]) go Create Index [IX_Relationship99] ON [GroupUsageExclusion] ([UsageTypeId]) go Create Index [IX_Relationship129] ON [PriceBandUsage] ([UsageTypeId]) go Create Index [IX_Relationship181] ON [TranslatedUsageType] ([UsageTypeId]) go Create Index [IX_Relationship57] ON [AssetUse] ([AssetDownloadTypeId]) go Create Index [IX_Relationship60] ON [Asset] ([FileFormatId]) go Create Index [IX_Relationship83] ON [UsageTypeFormat] ([FormatId]) go Create Index [IX_Relationship265] ON [RepurposedAsset] ([FileFormatId]) go Create Index [IX_Relationship68] ON [AssetApproval] ([ApprovalStatusId]) go Create Index [IX_Relationship74] ON [OrgUnitGroup] ([OrgUnitId]) go Create Index [IX_Relationship101] ON [AssetBankUser] ([RequestedOrgUnitId]) go Create Index [IX_Relationship275] ON [OrgUnitForAgreement] ([OrgUnitId]) go Create Index [IX_Relationship79] ON [AssetPurchaseLog] ([ABOrderId]) go Create Index [IX_Relationship140] ON [AssetPurchasePriceBand] ([ABOrderId],[AssetId]) go Create Index [IX_Relationship183] ON [TranslatedUsageTypeFormat] ([UsageTypeFormatId]) go Create Index [IX_Relationship87] ON [GroupEmailRule] ([RuleId]) go Create Index [IX_Relationship102] ON [ListItem] ([ListId]) go Create Index [IX_Relationship103] ON [AssetBankUser] ([DivisionId]) go Create Index [IX_Relationship107] ON [GroupInSubscriptionModel] ([SubscriptionModelId]) go Create Index [IX_Relationship119] ON [Subscription] ([SubscriptionModelId]) go Create Index [IX_Relationship121] ON [SubscriptionModelUpgrade] ([FromId]) go Create Index [IX_Relationship122] ON [SubscriptionModelUpgrade] ([ToId]) go Create Index [IX_Relationship207] ON [TranslatedSubscriptionModel] ([SubscriptionModelId]) go Create Index [IX_Relationship110] ON [AssetBankUser] ([AddressId]) go Create Index [IX_Relationship139] ON [ABOrder] ([ShippingAddressId]) go Create Index [IX_Relationship109] ON [Address] ([CountryId]) go Create Index [IX_Relationship118] ON [CountryInTaxRegion] ([CountryId]) go Create Index [IX_Relationship113] ON [TaxValue] ([TaxTypeId]) go Create Index [IX_Relationship218] ON [TranslatedTaxType] ([TaxTypeId]) go Create Index [IX_Relationship115] ON [TaxValue] ([TaxRegionId]) go Create Index [IX_Relationship117] ON [CountryInTaxRegion] ([TaxRegionId]) go Create Index [IX_Relationship131] ON [ShippingCost] ([TaxRegionId]) go Create Index [IX_Relationship206] ON [TranslatedTaxRegion] ([TaxRegionId]) go Create Index [IX_Relationship125] ON [SortAttribute] ([SortAreaId]) go Create Index [IX_Relationship130] ON [PriceBandUsage] ([PriceBandId]) go Create Index [IX_Relationship132] ON [ShippingCost] ([PriceBandId]) go Create Index [IX_Relationship136] ON [AssetBoxPriceBand] ([PriceBandId]) go Create Index [IX_Relationship205] ON [TranslatedPriceBand] ([PriceBandId]) go Create Index [IX_Relationship128] ON [PriceBand] ([PriceBandTypeId]) go Create Index [IX_Relationship204] ON [TranslatedPriceBandType] ([PriceBandTypeId]) go Create Index [IX_Relationship133] ON [ShippingCost] ([QuantityRangeId]) go Create Index [IX_Relationship145] ON [CommercialOptionPurchase] ([CommercialOptionId]) go Create Index [IX_Relationship202] ON [TranslatedCommercialOption] ([CommercialOptionId]) go Create Index [IX_Relationship138] ON [ABOrder] ([OrderStatusId]) go Create Index [IX_Relationship208] ON [TranslatedOrderStatus] ([OrderStatusId]) go Create Index [IX_Relationship146] ON [CommercialOptionPurchase] ([PriceBandId],[ABOrderId],[AssetId]) go Create Index [IX_Relationship141] ON [OrderStatus] ([OrderWorkflowId]) go Create Index [IX_Relationship147] ON [FeaturedAssetInBrand] ([BrandId]) go Create Index [IX_Relationship149] ON [UserGroup] ([BrandId]) go Create Index [IX_Relationship152] ON [ListItem] ([ListItemTextTypeId]) go Create Index [IX_Relationship155] ON [GroupIsRole] ([RoleId]) go Create Index [IX_Relationship156] ON [EmailTemplate] ([LanguageId]) go Create Index [IX_Relationship174] ON [TranslatedAttribute] ([LanguageId]) go Create Index [IX_Relationship175] ON [TranslatedAttributeValue] ([LanguageId]) go Create Index [IX_Relationship178] ON [TranslatedCategory] ([LanguageId]) go Create Index [IX_Relationship179] ON [ListItem] ([LanguageId]) go Create Index [IX_Relationship180] ON [AssetBankUser] ([LanguageId]) go Create Index [IX_Relationship182] ON [TranslatedUsageType] ([LanguageId]) go Create Index [IX_Relationship184] ON [TranslatedUsageTypeFormat] ([LanguageId]) go Create Index [IX_Relationship186] ON [TranslatedFilter] ([LanguageId]) go Create Index [IX_Relationship197] ON [TranslatedMarketingGroup] ([LanguageId]) go Create Index [IX_Relationship201] ON [TranslatedCommercialOption] ([LanguageId]) go Create Index [IX_Relationship203] ON [TranslatedPriceBandType] ([LanguageId]) go Create Index [IX_Relationship209] ON [TranslatedPriceBand] ([LanguageId]) go Create Index [IX_Relationship210] ON [TranslatedTaxRegion] ([LanguageId]) go Create Index [IX_Relationship211] ON [TranslatedSubscriptionModel] ([LanguageId]) go Create Index [IX_Relationship212] ON [TranslatedOrderStatus] ([LanguageId]) go Create Index [IX_Relationship216] ON [TranslatedMarketingEmail] ([LanguageId]) go Create Index [IX_Relationship217] ON [TranslatedTaxType] ([LanguageId]) go Create Index [IX_Relationship231] ON [TranslatedCustomField] ([LanguageId]) go Create Index [IX_Relationship251] ON [TranslatedAssetEntity] ([LanguageId]) go Create Index [IX_Relationship252] ON [TranslatedEntityRelationship] ([LanguageId]) go Create Index [IX_Relationship271] ON [TranslatedAgreement] ([LanguageId]) go Create Index [IX_Relationship277] ON [TranslatedNewsItem] ([LanguageId]) go Create Index [IX_Relationship1642] ON [EmbeddedDataMapping] ([EmbeddedDataValueId]) go Create Index [IX_Relationship15822] ON [EmbeddedDataValue] ([EmbeddedDataTypeId]) go Create Index [IX_Relationship1652] ON [EmbeddedDataMapping] ([MappingDirectionId]) go Create Index [IX_Relationship165] ON [ScheduledReportGroup] ([ReportId]) go Create Index [IX_Relationship164222] ON [FilterAttributeValue] ([FilterId]) go Create Index [IX_Relationship185] ON [TranslatedFilter] ([FilterId]) go Create Index [IX_Relationship261] ON [FilterInGroup] ([FilterId]) go Create Index [IX_Relationship287] ON [GroupFilterExclusion] ([FilterId]) go Create Index [IX_Relationship289] ON [FilterForCategory] ([FilterId]) go Create Index [IX_Relationship1662] ON [UserInMarketingGroup] ([MarketingGroupId]) go Create Index [IX_Relationship196] ON [TranslatedMarketingGroup] ([MarketingGroupId]) go Create Index [IX_Relationship190222] ON [CustomField] ([UsageTypeId]) go Create Index [IX_Relationship191222] ON [CustomFieldValue] ([CustomFieldId]) go Create Index [IX_Relationship201222] ON [CustomFieldValueMapping] ([CustomFieldId]) go Create Index [IX_Relationship232] ON [TranslatedCustomField] ([CustomFieldId]) go Create Index [IX_Relationship187222] ON [CustomField] ([TypeId]) go Create Index [IX_Relationship200222] ON [CustomFieldValueMapping] ([ListValue]) go Create Index [IX_Relationship198] ON [EmailTemplate] ([TypeId]) go Create Index [IX_Relationship2162] ON [AssetInMarketingEmail] ([MarketingEmailId]) go Create Index [IX_Relationship215] ON [TranslatedMarketingEmail] ([MarketingEmailId]) go Create Index [IX_Relationship229] ON [AssetChangeLog] ([LogTypeId]) go Create Index [IX_Relationship237] ON [AssetUse] ([SessionLogId]) go Create Index [IX_Relationship238] ON [AssetView] ([SessionLogId]) go Create Index [IX_Relationship239] ON [AssetChangeLog] ([SessionLogId]) go Create Index [IX_Relationship23322] ON [AllowableEntityRelationship] ([AssetEntityId]) go Create Index [IX_Relationship23522] ON [AssetEntityAttribute] ([AssetEntityId]) go Create Index [IX_Relationship23822] ON [AllowableEntityAssetType] ([AssetEntityId]) go Create Index [IX_Relationship2412] ON [TranslatedAssetEntity] ([AssetEntityId]) go Create Index [IX_Relationship2502] ON [AllowableEntityRelationship] ([RelatesToAssetEntityId]) go Create Index [IX_Relationship256] ON [Asset] ([AssetEntityId]) go Create Index [IX_Relationship2472] ON [TranslatedEntityRelationship] ([AssetEntityId],[RelationshipTypeId]) go Create Index [IX_Relationship23422] ON [AllowableEntityRelationship] ([RelationshipTypeId]) go Create Index [IX_Relationship255] ON [RelatedAsset] ([RelationshipTypeId]) go Create Index [IX_Relationship258] ON [Filter] ([FilterTypeId]) go Create Index [IX_Relationship260] ON [FilterGroup] ([FilterTypeId]) go Create Index [IX_Relationship262] ON [FilterInGroup] ([GroupId]) go Create Index [IX_Relationship266] ON [ChangeAttributeValueDateRule] ([ActionOnAssetId]) go Create Index [IX_Relationship267] ON [AttributeValue] ([ActionOnAssetId]) go Create Index [IX_Relationship269] ON [TranslatedAgreement] ([AgreementId]) go Create Index [IX_Relationship272] ON [AssetAgreement] ([AgreementId]) go Create Index [IX_Relationship274] ON [OrgUnitForAgreement] ([AgreementId]) go Create Index [IX_Relationship2702] ON [TranslatedNewsItem] ([NewsItemId]) go Create Index [IX_Relationship286] ON [UsageTypeFormat] ([ConvertToColorSpaceId]) go