Skip to content

Commit a38a180

Browse files
authored
[O2B-1539] Add index on QC flags to help GAQ summary computation (#2099)
* Add a composite index on quality_control_flags(run_number, detector_id) that proved to reduce computation time for GAQ summary by approx 50% with the caveat it was tested only on a local machine.
1 parent cb698d6 commit a38a180

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* @license
3+
* Copyright CERN and copyright holders of ALICE O2. This software is
4+
* distributed under the terms of the GNU General Public License v3 (GPL
5+
* Version 3), copied verbatim in the file "COPYING".
6+
*
7+
* See http://alice-o2.web.cern.ch/license for full licensing information.
8+
*
9+
* In applying this license CERN does not waive the privileges and immunities
10+
* granted to it by virtue of its status as an Intergovernmental Organization
11+
* or submit itself to any jurisdiction.
12+
*/
13+
14+
'use strict';
15+
16+
/** @type {import('sequelize-cli').Migration} */
17+
module.exports = {
18+
up: async (queryInterface) => queryInterface.sequelize.transaction(async (transaction) => {
19+
await queryInterface.addIndex('quality_control_flags', {
20+
name: 'quality_control_flags_run_detector_idx',
21+
fields: ['run_number', 'detector_id'],
22+
}, { transaction });
23+
}),
24+
25+
down: async (queryInterface) => queryInterface.sequelize.transaction(async (transaction) => {
26+
await queryInterface.removeIndex('quality_control_flags', 'quality_control_flags_run_detector_idx', { transaction });
27+
}),
28+
};

0 commit comments

Comments
 (0)