
CREATE TABLE ppl2grp2subj_new (
	ppl2grp2subj_id INTEGER PRIMARY KEY AUTO_INCREMENT,
	ppl_id INTEGER NOT NULL,
	grp2subj_id INTEGER NOT NULL,
	ppl_enter INTEGER NOT NULL, -- seconds since epoch
	ppl_exit INTEGER NOT NULL -- seconds since epoch
);
CREATE INDEX ppl2grp2subj0_new ON ppl2grp2subj_new ( ppl_id );
CREATE INDEX ppl2grp2subj1_new ON ppl2grp2subj_new ( grp2subj_id );

INSERT INTO ppl2grp2subj_new ( ppl_id, grp2subj_id, ppl_enter, ppl_exit ) SELECT ppl_id, grp2subj_id, ppl_enter, ppl_exit FROM ppl2grp2subj
