Page MenuHomePhabricator

Suggested Investigations: Remove default from sic_updated_timestamp and drop indexes on sic_created_timestamp in cusi_case
Closed, ResolvedPublic

Description

Summary

Per T411821, once T411788: Suggested investigations: Replace 'Created' timestamp column with 'Updated' timestamp column in table pager is completed we should drop the default on the sic_updated_timestamp column and remove the indexes on sic_created_timestamp

Proposed schema changes

After the column is appropriately populated (using the current values of sic_created_timestamp), then remove the default from sic_updated_timestamp:

> describe cusi_case;
+-----------------------+---------------------+------+-----+----------------+----------------+
| Field                 | Type                | Null | Key | Default        | Extra          |
+-----------------------+---------------------+------+-----+----------------+----------------+
| sic_id                | int(10) unsigned    | NO   | PRI | NULL           | auto_increment |
...
| sic_updated_timestamp | binary(14)          | NO   | MUL | NULL           |                |
+-----------------------+---------------------+------+-----+----------------+----------------+

Also drop any index with sic_created_timestamp in it from the cusi_case table

Acceptance criteria

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change #1238817 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/CheckUser@master] Remove default from sic_updated_timestamp in cusi_case

https://gerrit.wikimedia.org/r/1238817

Change #1238820 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/CheckUser@master] Drop indexes on sic_created_timestamp in cusi_case table

https://gerrit.wikimedia.org/r/1238820

Change #1238817 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Remove default from sic_updated_timestamp in cusi_case

https://gerrit.wikimedia.org/r/1238817

Change #1238820 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Drop indexes on sic_created_timestamp in cusi_case table

https://gerrit.wikimedia.org/r/1238820

dom_walden subscribed.

The cusi_case table locally. sic_created_timestamp has no index associated with it. sic_updated_timestamp default is NULL:

DESCRIBE cusi_case;
MariaDB [enwiki]>
+-----------------------+---------------------+------+-----+---------+----------------+
| Field                 | Type                | Null | Key | Default | Extra          |
+-----------------------+---------------------+------+-----+---------+----------------+
| sic_id                | int(10) unsigned    | NO   | PRI | NULL    | auto_increment |
| sic_status            | tinyint(3) unsigned | NO   | MUL | 0       |                |
| sic_status_reason     | varbinary(255)      | NO   |     |         |                |
| sic_created_timestamp | binary(14)          | NO   |     | NULL    |                |
| sic_url_identifier    | int(10) unsigned    | NO   | UNI | NULL    |                |
| sic_updated_timestamp | binary(14)          | NO   | MUL | NULL    |                |
+-----------------------+---------------------+------+-----+---------+----------------+

SHOW INDEXES FROM cusi_case;
MariaDB [enwiki]>
+-----------+------------+---------------------------------+--------------+-----------------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| Table     | Non_unique | Key_name                        | Seq_in_index | Column_name           | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+-----------+------------+---------------------------------+--------------+-----------------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| cusi_case |          0 | PRIMARY                         |            1 | sic_id                | A         |       22254 |     NULL | NULL   |      | BTREE      |         |               |
| cusi_case |          0 | sic_url_identifier              |            1 | sic_url_identifier    | A         |       22254 |     NULL | NULL   |      | BTREE      |         |               |
| cusi_case |          0 | sic_status_updated_timestamp_id |            1 | sic_status            | A         |           4 |     NULL | NULL   |      | BTREE      |         |               |
| cusi_case |          0 | sic_status_updated_timestamp_id |            2 | sic_updated_timestamp | A         |         148 |     NULL | NULL   |      | BTREE      |         |               |
| cusi_case |          0 | sic_status_updated_timestamp_id |            3 | sic_id                | A         |       22254 |     NULL | NULL   |      | BTREE      |         |               |
| cusi_case |          0 | sic_updated_timestamp_id        |            1 | sic_updated_timestamp | A         |         124 |     NULL | NULL   |      | BTREE      |         |               |
| cusi_case |          0 | sic_updated_timestamp_id        |            2 | sic_id                | A         |       22254 |     NULL | NULL   |      | BTREE      |         |               |
+-----------+------------+---------------------------------+--------------+-----------------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
Dreamy_Jazz updated the task description. (Show Details)

Thanks!