Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
sql
sql
DROP TABLE IF EXISTS "metaData";
CREATE TABLE "metaData" (
  "metaID" bigint(20) NOT NULL,
  "ip_name_src" varchar(52) NOT NULL default '',
  "ip_name_dst" varchar(52) NOT NULL default '',
  "transport" varchar(10) NOT NULL default '',
  "packetSize" smallint(6) NOT NULL default '0',
  "count" smallint(6) NOT NULL default '0',
  "packetInterval" smallint(6) default NULL,
  "deadline" smallint(6) default NULL,
  "ttl" smallint(6) default NULL,
  PRIMARY KEY  ("metaID"),
  UNIQUE ("ip_name_src","ip_name_dst","packetSize","count")
);

DROP TABLE IF EXISTS data_200112;
CREATE TABLE data_200112 (
  metaID bigint(20) NOT NULL default 0,
  minRtt float default NULL,
  meanRtt float default NULL,
  medianRtt float default NULL,
  maxRtt float default NULL,
  timestamp bigint(12) NOT NULL default 0,
  minIpd float default NULL,
  meanIpd float default NULL,
  maxIpd float default NULL,
  duplicates tinyint(1) default NULL,
  outOfOrder tinyint(1) default NULL,
  clp float default NULL,
  iqrIpd float default NULL,
  lossPercent float default NULL,
  rtts text,
  seqNums text,
  PRIMARY KEY  (metaID,timestamp),
  KEY meanRtt (meanRtt,medianRtt,lossPercent,meanIpd,clp)
);

SQLite table structure

Only minor changes were required for SQLite compliance. SQLite does not support referential integrity so foreign key definitions must be removed and it does not support constraint names or indexes defined in the table definition with the 'KEY' or 'INDEX' keywords.

...

No Format
jaredg@atreides > time sqlite3 perftest.db < metadata_data.sql
0.077u 0.098s 0:01.16 13.7%     0+0k 0+0io 0pf+0w

jaredg@atreides > time sh sqlite_load.sh
42.961u 2.456s 0:50.38 90.1%    0+0k 0+0io 0pf+0w

Contents of sqlite_load.sh - begin_txn.sql and commit.sql contain the SQL statements described above

No Format

cat begin_txn.sql data_insert.sql commit.sql | sqlite3 data.db