From 7bac5224be399f891a370672e9566082a128c87d Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Mon, 20 Mar 2023 21:55:38 -0700 Subject: [PATCH] civicrm_cache - Add index on `expired_date` --- CRM/Core/DAO/Cache.php | 10 +++++++++- CRM/Upgrade/Incremental/php/FiveSixtyOne.php | 1 + xml/schema/Core/Cache.xml | 5 +++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CRM/Core/DAO/Cache.php b/CRM/Core/DAO/Cache.php index 71f4552d31..811227f421 100644 --- a/CRM/Core/DAO/Cache.php +++ b/CRM/Core/DAO/Cache.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Core/Cache.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:7ef203eece225df98205318c7162ebd1) + * (GenCodeChecksum:5d62ee8a59b8af12078317776d33877c) */ /** @@ -321,6 +321,14 @@ class CRM_Core_DAO_Cache extends CRM_Core_DAO { 'unique' => TRUE, 'sig' => 'civicrm_cache::1::group_name::path', ], + 'index_expired_date' => [ + 'name' => 'index_expired_date', + 'field' => [ + 0 => 'expired_date', + ], + 'localizable' => FALSE, + 'sig' => 'civicrm_cache::0::expired_date', + ], ]; return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; } diff --git a/CRM/Upgrade/Incremental/php/FiveSixtyOne.php b/CRM/Upgrade/Incremental/php/FiveSixtyOne.php index c621f9b55e..31b99a7965 100644 --- a/CRM/Upgrade/Incremental/php/FiveSixtyOne.php +++ b/CRM/Upgrade/Incremental/php/FiveSixtyOne.php @@ -49,6 +49,7 @@ class CRM_Upgrade_Incremental_php_FiveSixtyOne extends CRM_Upgrade_Incremental_B $this->addTask(ts('Dedupe cache table'), 'dedupeCache'); $this->addTask(ts('Drop index %1', [1 => 'civicrm_cache.UI_group_path_date']), 'dropIndex', 'civicrm_cache', 'UI_group_path_date'); $this->addTask(ts('Create index %1', [1 => 'civicrm_cache.UI_group_name_path']), 'addIndex', 'civicrm_cache', [['group_name', 'path']], 'UI'); + $this->addTask(ts('Create index %1', [1 => 'civicrm_cache.index_expired_date']), 'addIndex', 'civicrm_cache', [['expired_date']], 'index'); } /** diff --git a/xml/schema/Core/Cache.xml b/xml/schema/Core/Cache.xml index 9e69ada0f1..71611853cf 100644 --- a/xml/schema/Core/Cache.xml +++ b/xml/schema/Core/Cache.xml @@ -100,4 +100,9 @@ When should the cache item expire 2.1 + + index_expired_date + expired_date + 5.61 + -- 2.25.1