Skip to content

TaskQueueDB: no need for TaskIndex indexes, they can be dropped altogether. #8468

@fstagni

Description

@fstagni

The TQId,Value pair is the PRIMARY KEY in this table. So, the corresponding index is anyway created.
It is probably just better to drop the "TaskIndex": ["TQId"]

As additional context, this is what I see in the certification setup:

Dirac@dbod-dcertif.cern.ch
(MySQL):TaskQueueDB>describe `tq_TQToBannedSites`
+-------+--------------+------+-----+---------+-------+
| Field | Type         | Null | Key | Default | Extra |
+-------+--------------+------+-----+---------+-------+
| TQId  | int unsigned | NO   | PRI | <null>  |       |
| Value | varchar(64)  | NO   | PRI | <null>  |       |
+-------+--------------+------+-----+---------+-------+

2 rows in set
Time: 0.011s
Dirac@dbod-dcertif.cern.ch
(MySQL):TaskQueueDB>show INDEX FROM `tq_TQToBannedSites`
+--------------------+------------+------------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+------------+
| Table              | Non_unique | Key_name         | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | Visible | Expression |
+--------------------+------------+------------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+------------+
| tq_TQToBannedSites | 0          | PRIMARY          | 1            | TQId        | A         | 0           | <null>   | <null> |      | BTREE      |         |               | YES     | <null>     |
| tq_TQToBannedSites | 0          | PRIMARY          | 2            | Value       | A         | 0           | <null>   | <null> |      | BTREE      |         |               | YES     | <null>     |
| tq_TQToBannedSites | 1          | TaskIndex        | 1            | TQId        | A         | 0           | <null>   | <null> |      | BTREE      |         |               | YES     | <null>     |
| tq_TQToBannedSites | 1          | BannedSitesIndex | 1            | Value       | A         | 0           | <null>   | <null> |      | BTREE      |         |               | YES     | <null>     |
+--------------------+------------+------------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+------------+

Originally posted by @fstagni in #8462 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions