DROP TABLE IF EXISTS Routes; DROP TABLE IF EXISTS Records; DROP TABLE IF EXISTS Old_Routes; DROP TABLE IF EXISTS Old_Records; CREATE TABLE ASpaths ( id int (11) NOT NULL auto_increment, len tinyint (3) unsigned, crc char (32) NOT NULL, path TEXT, PRIMARY KEY (id) ); CREATE INDEX aspaths ON ASpaths (len,crc); CREATE TABLE Routes ( id int (11) NOT NULL auto_increment, len int (1) NOT NULL, crc char (32) NOT NULL, route TEXT, PRIMARY KEY (id) ); CREATE INDEX routes ON Routes (len,crc); CREATE TABLE Records ( id int (11) NOT NULL auto_increment, src int (11) NOT NULL, dst int (11) NOT NULL, routeid int (11) NOT NULL, aspathid int (11) NOT NULL, tstart int (11) NOT NULL, tend int (11) NOT NULL, numrec int (11) NOT NULL, PRIMARY KEY (id) ); CREATE INDEX records ON Records (src,dst,routeid,aspathid,tstart,tend); CREATE INDEX queries ON Records (src,tstart,tend); ################################################### # Storage / Backup CREATE TABLE Old_ASpaths ( id int (11) NOT NULL auto_increment, len tinyint (3) unsigned, crc char (32) NOT NULL, path TEXT, PRIMARY KEY (id) ); CREATE INDEX aspaths ON Old_ASpaths (len,crc); CREATE TABLE Old_Routes ( id int (11) NOT NULL auto_increment, len int (1) NOT NULL, crc char (32) NOT NULL, route TEXT, PRIMARY KEY (id) ); CREATE INDEX routes ON Old_Routes (len,crc); CREATE TABLE Old_Records ( id int (11) NOT NULL auto_increment, src int (11) NOT NULL, dst int (11) NOT NULL, routeid int (11) NOT NULL, aspathid int (11) NOT NULL, tstart int (11) NOT NULL, tend int (11) NOT NULL, numrec int (11) NOT NULL, PRIMARY KEY (id) ); CREATE INDEX records ON Old_Records (src,dst,routeid,aspathid,tstart,tend);