From 250b263e587cd0bac0a9ce9d8f6226a9677507ed Mon Sep 17 00:00:00 2001 From: Isaac Hill <71404865+isaachilly@users.noreply.github.com> Date: Thu, 5 Mar 2026 17:34:18 +0100 Subject: [PATCH 1/2] [O2B-1539] Add index on QC flags to help GAQ summary computation Add a composite index on quality_control_flags(run_number, detector_id) that proved to reduce computation time for GAQ summary by 50% on local. --- .../20260305110000-add-qcf-run-detector-index.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 lib/database/migrations/v1/20260305110000-add-qcf-run-detector-index.js diff --git a/lib/database/migrations/v1/20260305110000-add-qcf-run-detector-index.js b/lib/database/migrations/v1/20260305110000-add-qcf-run-detector-index.js new file mode 100644 index 0000000000..d0c86d8c7d --- /dev/null +++ b/lib/database/migrations/v1/20260305110000-add-qcf-run-detector-index.js @@ -0,0 +1,15 @@ +'use strict'; + +/** @type {import('sequelize-cli').Migration} */ +module.exports = { + up: async (queryInterface) => queryInterface.sequelize.transaction(async (transaction) => { + await queryInterface.addIndex('quality_control_flags', { + name: 'quality_control_flags_run_detector_idx', + fields: ['run_number', 'detector_id'], + }, { transaction }); + }), + + down: async (queryInterface) => queryInterface.sequelize.transaction(async (transaction) => { + await queryInterface.removeIndex('quality_control_flags', 'quality_control_flags_run_detector_idx', { transaction }); + }), +}; From 7861dfbfc2a0763e4d1baecdefd66ddbc917e6a8 Mon Sep 17 00:00:00 2001 From: Isaac Hill <71404865+isaachilly@users.noreply.github.com> Date: Fri, 6 Mar 2026 10:27:14 +0100 Subject: [PATCH 2/2] [O2B-1539] Add GPLv3 license header Add missing CERN/ALICE GPLv3 license header to migration file. --- .../v1/20260305110000-add-qcf-run-detector-index.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/database/migrations/v1/20260305110000-add-qcf-run-detector-index.js b/lib/database/migrations/v1/20260305110000-add-qcf-run-detector-index.js index d0c86d8c7d..4c04e5920e 100644 --- a/lib/database/migrations/v1/20260305110000-add-qcf-run-detector-index.js +++ b/lib/database/migrations/v1/20260305110000-add-qcf-run-detector-index.js @@ -1,3 +1,16 @@ +/* + * @license + * Copyright CERN and copyright holders of ALICE O2. This software is + * distributed under the terms of the GNU General Public License v3 (GPL + * Version 3), copied verbatim in the file "COPYING". + * + * See http://alice-o2.web.cern.ch/license for full licensing information. + * + * In applying this license CERN does not waive the privileges and immunities + * granted to it by virtue of its status as an Intergovernmental Organization + * or submit itself to any jurisdiction. + */ + 'use strict'; /** @type {import('sequelize-cli').Migration} */