Closed Bug 1304332 Opened 8 years ago Closed 7 years ago

Differences in the performance_signature table schema between environments

Categories

(Tree Management :: Perfherder, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: emorley, Assigned: wlach)

References

Details

Attachments

(1 file)

Blocks: 1226693
Updated diff:

--- schema-vagrant.sql
+++ schema-prod.sql
...
 CREATE TABLE `performance_signature` (
   `id` int(11) NOT NULL AUTO_INCREMENT,
   `signature_hash` varchar(40) COLLATE utf8_bin NOT NULL,
   `suite` varchar(80) COLLATE utf8_bin NOT NULL,
   `test` varchar(80) COLLATE utf8_bin NOT NULL,
   `lower_is_better` tinyint(1) NOT NULL,
   `last_updated` datetime(6) NOT NULL,
   `has_subtests` tinyint(1) NOT NULL,
   `extra_options` varchar(60) COLLATE utf8_bin NOT NULL,
   `should_alert` tinyint(1) DEFAULT NULL,
   `alert_threshold` double DEFAULT NULL,
   `min_back_window` int(11) DEFAULT NULL,
   `max_back_window` int(11) DEFAULT NULL,
   `fore_window` int(11) DEFAULT NULL,
   `framework_id` int(11) NOT NULL,
   `option_collection_id` int(11) NOT NULL,
   `parent_signature_id` int(11) DEFAULT NULL,
   `platform_id` int(11) NOT NULL,
   `repository_id` int(11) NOT NULL,
   PRIMARY KEY (`id`),
   UNIQUE KEY `<NAME>` (`repository_id`,`framework_id`,`signature_hash`),
   KEY `<NAME>` (`framework_id`),
   KEY `<NAME>` (`option_collection_id`),
   KEY `<NAME>` (`parent_signature_id`),
   KEY `<NAME>` (`platform_id`),
-  KEY `<NAME>` (`signature_hash`),
   KEY `<NAME>` (`last_updated`),
+  KEY `<NAME>` (`suite`,`test`,`lower_is_better`,`repository_id`,`framework_id`,`platform_id`,`option_collection_id`),
   CONSTRAINT `<NAME>` FOREIGN KEY (`parent_signature_id`) REFERENCES `performance_signature` (`id`),
   CONSTRAINT `<NAME>` FOREIGN KEY (`option_collection_id`) REFERENCES `option_collection` (`id`),
   CONSTRAINT `<NAME>` FOREIGN KEY (`framework_id`) REFERENCES `performance_framework` (`id`),
   CONSTRAINT `<NAME>` FOREIGN KEY (`platform_id`) REFERENCES `machine_platform` (`id`),
   CONSTRAINT `<NAME>` FOREIGN KEY (`repository_id`) REFERENCES `repository` (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
Couple of questions:
* Prod is missing the index on `signature_hash` - I'm presuming we want that index (so should add it instead of adjusting the model)
* Prod has an extra composite index not in the model - do we need it (and so should add it to the model)? The index:
(`suite`,`test`,`lower_is_better`,`repository_id`,`framework_id`,`platform_id`,`option_collection_id`)
Flags: needinfo?(wlachance)
Hmm, to be honest I can't remember making these changes. :)

I would be inclined to reset things to match the vagrant instance on stage and validate that things are still reasonably fast. If there are issues (i.e. we were actually depending on the index), we can add it to the model. I'll do this sometime this week, leaving NI open so I don't forget.
It it helps, I've just checked stage and for indexes it's the same as prod (additional composite index, and missing the `signature_hash` index), albeit the column definitions vary slightly.
This fell down in my priority list, but I will pick it up next week, promise.
Assignee: nobody → wlachance
Flags: needinfo?(wlachance)
Comment on attachment 8836753 [details] [review]
[treeherder] wlach:1304332 > mozilla:master

Let's just do the simplest thing possible here to synchronize the two. I very much doubt the performance signature table is a bottleneck for anything (it's small).

* I have manually removed the extra index from production/stage. 
* Here's a migration to remove the signature_hash index from vagrant.
Attachment #8836753 - Flags: review?(emorley)
Comment on attachment 8836753 [details] [review]
[treeherder] wlach:1304332 > mozilla:master

> * I have manually removed the extra index from production/stage. 

Prototype too? :-)
Attachment #8836753 - Flags: review?(emorley) → review+
Thank you for looking at this :-)
Commit pushed to master at https://github.com/mozilla/treeherder

https://github.com/mozilla/treeherder/commit/0d55215d73806d7d4a3297c00ada63787ae1d979
Bug 1304332 - Remove index on signature_hash (#2160)

We've been happily running without it in production for a while, so
let's just remove it.
(In reply to Ed Morley [:emorley] from comment #9)
> Comment on attachment 8836753 [details] [review]
> [treeherder] wlach:1304332 > mozilla:master
> 
> > * I have manually removed the extra index from production/stage. 
> 
> Prototype too? :-)

No, but just took care of it!
:-D
The migration deployed fine on prod.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: