civicrm_saved_search FK in civicrm_group should be ON DELETE CACSCADE
The foreign key in civicrm_group
CONSTRAINT `FK_civicrm_group_saved_search_id` FOREIGN KEY (`saved_search_id`) REFERENCES `civicrm_saved_search` (`id`) ON DELETE SET NULL
ON DELETE SET NULL which assumes that there is a use for a saved search that was linked to a group even when that group is deleted. I don't think this is the case. I think it should be
ON DELETE CACSCADE.
Does this seem reasonable to people? If people agree, I can add a couple of lines to the upgrade script.