Closed Bug 1145566 Opened 10 years ago Closed 9 years ago

Review and remove useless indexes on "addons" table

Categories

(Marketplace Graveyard :: Code Quality, defect, P4)

Avenir
defect

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: mat, Unassigned)

References

Details

(Whiteboard: [marketplace-transition])

The addons table has quite a history, since it was initially made for AMO. Lots of fields have been created and deleted since, queries are completely different now that AMO and MKT are split... the result is that we have some duplicate or useless indexes left in the table. We should review and remove those we don't really need for performance and code quality (we are forcing some queries to use indexes instead because it made sense at the time, but now it doesn't necessarily still make sense). Also, we should modify our models.py to match the indexes that exist in the SQL, to help developers reproduce a realistic environment locally. Currently we have: PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`), UNIQUE KEY `guid` (`guid`), UNIQUE KEY `app_slug` (`app_slug`), KEY `addons_ibfk_3` (`homepage`), KEY `addons_ibfk_4` (`description`), KEY `addons_ibfk_8` (`privacypolicy`), KEY `status` (`status`), KEY `inactive` (`inactive`), KEY `supporturl` (`supporturl`), KEY `supportemail` (`supportemail`), KEY `bayesianrating` (`bayesianrating`), KEY `last_updated` (`last_updated`), KEY `current_version` (`current_version`), KEY `created_idx` (`created`), KEY `modified_idx` (`modified`), KEY `rating_type_idx` (`bayesianrating`), KEY `created_type_idx` (`created`), KEY `modified_type_idx` (`modified`), KEY `last_updated_type_idx` (`last_updated`), KEY `type_status_inactive_idx` (`status`,`inactive`), KEY `visible_idx` (`status`,`inactive`,`current_version`), KEY `premium_type_idx` (`premium_type`), KEY `addons_609c04a9` (`app_domain`), KEY `addons_is_packaged` (`is_packaged`), KEY `latest_version_refs_versions` (`latest_version`), KEY `addons_enable_new_regions` (`enable_new_regions`), KEY `name_2` (`name`,`status`), CONSTRAINT `addons_ibfk_10` FOREIGN KEY (`supportemail`) REFERENCES `translations` (`id`), CONSTRAINT `addons_ibfk_14` FOREIGN KEY (`current_version`) REFERENCES `versions` (`id`) ON DELETE SET NULL, CONSTRAINT `addons_ibfk_2` FOREIGN KEY (`name`) REFERENCES `translations` (`id`), CONSTRAINT `addons_ibfk_3` FOREIGN KEY (`homepage`) REFERENCES `translations` (`id`), CONSTRAINT `addons_ibfk_4` FOREIGN KEY (`description`) REFERENCES `translations` (`id`), CONSTRAINT `addons_ibfk_8` FOREIGN KEY (`privacypolicy`) REFERENCES `translations` (`id`), CONSTRAINT `addons_ibfk_9` FOREIGN KEY (`supporturl`) REFERENCES `translations` (`id`), CONSTRAINT `latest_version_refs_versions` FOREIGN KEY (`latest_version`) REFERENCES `versions` (`id`) ON DELETE SET NULL Note that we can't avoid the translations ones atm. But at the very least, `rating_type_idx`, `created_type_idx` and `modified_type_idx` are useless.
Severity: normal → trivial
Priority: -- → P4
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WONTFIX
Whiteboard: [marketplace-transition]
You need to log in before you can comment on or make changes to this bug.