Closed Bug 1178225 Opened 10 years ago Closed 10 years ago

Remove the unused result_set_classification table

Categories

(Tree Management :: Treeherder, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: emorley, Assigned: emorley)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

We're not currently using this table - let's just remove it until an actual use-case makes itself clear. (And most of the use cases can likely be solved by dymanically querying the jobs linked to a result set - without the need to permanently store the resultant state such as "contains broken commits").
Blocks: 1178227
Attachment #8627418 - Flags: review?(cdawson)
Status: NEW → ASSIGNED
Comment on attachment 8627418 [details] [review] Remove the result_set_classification table Switching review to Mauro, to balance them out a bit :-) Once this lands & is deployed, I'll do a: manage.py run_sql -s "ALTER TABLE result_set DROP COLUMN result_set_classification_id;" (according to http://dev.mysql.com/doc/refman/5.1/en/alter-table.html , the index will be automatically removed when I remove the field) ...on stage/prod. We'll also need to "DROP TABLE IF EXISTS treeherder.result_set_classification;" (I don't know why this table isn't in migrations/0001_initial.py, otherwise I'd say use migrations to do this part?)
Attachment #8627418 - Flags: review?(cdawson) → review?(mdoglio)
Attachment #8627418 - Flags: review?(mdoglio) → review+
[emorley@treeherder-rabbitmq1.stage.private.scl3 treeherder-service]$ time ../venv/bin/python ./manage.py run_sql -s "ALTER TABLE result_set DROP COLUMN result_set_classification_id;" SQL command: ALTER TABLE result_set DROP COLUMN result_set_classification_id; 66 datasource found -------------------------- Sql code executed on addon-sdk - jobs: -------------------------- Sql code executed on alder - jobs: <snip> real 0m8.281s user 0m1.106s sys 0m0.155s [emorley@treeherder-rabbitmq1.stage.private.scl3 treeherder-service]$ ../venv/bin/python ./manage.py run_sql -s "SHOW INDEX FROM result_set" --datasources mozilla-inbound,try SQL command: SHOW INDEX FROM result_set 2 datasource found -------------------------- Sql code executed on mozilla-inbound - jobs: ('result_set', 0L, 'PRIMARY', 1L, 'id', 'A', 1780L, None, None, '', 'BTREE', '', '') ('result_set', 0L, 'idx_revision_hash', 1L, 'revision_hash', 'A', 1780L, None, None, '', 'BTREE', '', '') ('result_set', 1L, 'idx_aggregate_id', 1L, 'aggregate_id', 'A', 2L, None, None, 'YES', 'BTREE', '', '') ('result_set', 1L, 'idx_author', 1L, 'author', 'A', 356L, None, None, '', 'BTREE', '', '') ('result_set', 1L, 'idx_type', 1L, 'type', 'A', 2L, None, None, 'YES', 'BTREE', '', '') ('result_set', 1L, 'idx_push_timestamp', 1L, 'push_timestamp', 'A', 1780L, None, None, '', 'BTREE', '', '') ('result_set', 1L, 'idx_active_status', 1L, 'active_status', 'A', 2L, None, None, 'YES', 'BTREE', '', '') -------------------------- Sql code executed on try - jobs: ('result_set', 0L, 'PRIMARY', 1L, 'id', 'A', 6702L, None, None, '', 'BTREE', '', '') ('result_set', 0L, 'idx_revision_hash', 1L, 'revision_hash', 'A', 6702L, None, None, '', 'BTREE', '', '') ('result_set', 1L, 'idx_aggregate_id', 1L, 'aggregate_id', 'A', 2L, None, None, 'YES', 'BTREE', '', '') ('result_set', 1L, 'idx_author', 1L, 'author', 'A', 744L, None, None, '', 'BTREE', '', '') ('result_set', 1L, 'idx_type', 1L, 'type', 'A', 2L, None, None, 'YES', 'BTREE', '', '') ('result_set', 1L, 'idx_push_timestamp', 1L, 'push_timestamp', 'A', 6702L, None, None, '', 'BTREE', '', '') ('result_set', 1L, 'idx_active_status', 1L, 'active_status', 'A', 4L, None, None, 'YES', 'BTREE', '', '') [emorley@treeherder-rabbitmq1.stage.private.scl3 treeherder-service]$ ../venv/bin/python ./manage.py dbshell mysql> SELECT table_schema, table_name FROM information_schema.tables WHERE table_name = 'result_set_classification'; +------------------+---------------------------+ | table_schema | table_name | +------------------+---------------------------+ | treeherder_stage | result_set_classification | +------------------+---------------------------+ 1 row in set (0.16 sec) mysql> DROP TABLE treeherder_stage.result_set_classification; Query OK, 0 rows affected (0.04 sec) mysql> SELECT table_schema, table_name FROM information_schema.tables WHERE table_name = 'result_set_classification'; Empty set (0.00 sec)
And prod... [emorley@treeherder-rabbitmq1.private.scl3 treeherder-service]$ time ../venv/bin/python ./manage.py run_sql -s "ALTER TABLE result_set DROP COLUMN result_set_classification_id;" SQL command: ALTER TABLE result_set DROP COLUMN result_set_classification_id; 72 datasource found -------------------------- Sql code executed on accessibility - jobs: <snip> real 0m14.433s user 0m0.931s sys 0m0.154s [emorley@treeherder-rabbitmq1.private.scl3 treeherder-service]$ ../venv/bin/python ./manage.py dbshell mysql> DROP TABLE treeherder.result_set_classification; Query OK, 0 rows affected (0.05 sec) mysql> SELECT table_schema, table_name FROM information_schema.tables WHERE table_name = 'result_set_classification'; Empty set (0.07 sec)
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Run on Heroku: [~/src/treeherder]$ heroku run './manage.py run_sql -s "ALTER TABLE result_set DROP COLUMN result_set_classification_id ;"' Running `./manage.py run_sql -s "ALTER TABLE result_set DROP COLUMN result_set_classification_id;"` attached to terminal... up, run.6753 SQL command: ALTER TABLE result_set DROP COLUMN result_set_classification_id; 44 datasource found -------------------------- Sql code executed on mozilla-central - jobs: -------------------------- Sql code executed on mozilla-inbound - jobs: -------------------------- Sql code executed on b2g-inbound - jobs: ... And: DROP TABLE treeherder.result_set_classification;
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: