 	-- remove all bad obs grouping by setting obs_group_id to null for any obs in a solitary group and its grouper concept is not a set 
 	SELECT 'Cleaning up the obs that think they are in an obs_group but really are not.' AS 'Current step (5/8):' FROM dual;
 	DROP TABLE IF EXISTS `single_member_obs_groups`;
-	CREATE TEMPORARY TABLE `single_member_obs_groups` (
+	CREATE TABLE `single_member_obs_groups` (
 	  `obs_id` int(11) NOT NULL,
       `obs_group_id` int(11) NOT NULL,
-	  PRIMARY KEY  (`obs_id`)
+	  PRIMARY KEY  (`obs_id`),
+	  KEY `the_group_id` (`obs_group_id`)
     ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 	INSERT INTO `single_member_obs_groups`
 		(obs_id,

			o2.obs_group_id;
	
	-- This changes the obs_group_ids on the obs table to point at the obs_id of the grouper obs
	UPDATE 
		`obs` o left join new_obs_groups_mapping mapping on o.obs_group_id = mapping.obs_group_id
	SET

	SELECT 'Voiding those obs groupers that are in all-voided groups' as 'Current step: (7/8)' FROM dual;
	-- create a temp table to hold the obs_id of obs groupers that need to be voided
	DROP TABLE IF EXISTS `obs_groupers_needing_voided`;
	CREATE TABLE `obs_groupers_needing_voided` (
		`obs_id` int(11) NOT NULL,
		`voided_by` int(11) default NULL,
		`date_voided` datetime default NULL,
