<?php
$_db_migration_to = '39.36'; // 8.13.47
if (!isset($migrations) || !is_object($migrations))
	die("This file cannot be executed directly");
$migrations->CheckValid($_db_migration_to);
//===========================================================================================



$migrations->Run('20240521_ic_hd_issues_indexes.php', <<<'DB_UPDATE_FILE'
<?php

/**
* BT-4654 IC/IC Dashboard slowness on the client server.
*
 * @var \Claromentis\Setup\SetupFacade $migrations
*/
$db = $migrations->GetDb();

// The index should be applied to the method `ICIssuesListProvider::GetListQuery()`. I suspect the query is getting slower during
// use Advance search form in issues list. Adding those index should improve that performance.
// However, the filter can be different depend of the user, probably more index should be applied for all columns.
$db->CreateIndex('hd_issue', 'idx_assigned_status_project_id', 'assigned', 'status', 'project_id');

DB_UPDATE_FILE
);


//===========================================================================================
$migrations->SetVersion('39.36');
