My schema is ``` sqlite> .schema CREATE TABLE IF NOT EXISTS "categories" ( "id" integer, "name" text NOT NULL, PRIMARY KEY("id"), UNIQUE("name") ); CREATE TABLE IF NOT EXISTS "labels" ( "id" integer, "name" text NOT NULL, PRIMARY KEY("id"), UNIQUE("name") ); CREATE TABLE IF NOT EXISTS "events" ( "id" integer, "label" integer NOT NULL, "channel" integer NOT NULL, "process" integer NOT NULL, "thread" integer NOT NULL, "timestamp" integer NOT NULL, "phase" text NOT NULL CHECK("phase" IN ('B', 'E', 'I', 'P')), PRIMARY KEY("id"), FOREIGN KEY("label") REFERENCES "labels"("id"), FOREIGN KEY("channel") REFERENCES "categories"("id"), FOREIGN KEY("process") REFERENCES "process"("id"), FOREIGN KEY("thread") REFERENCES "thread"("id") ); CREATE TABLE IF NOT EXISTS "process" ( "id" integer, "pid" integer NOT NULL, PRIMARY KEY("id"), UNIQUE("pid") ); CREATE TABLE IF NOT EXISTS "thread" ( "id" integer, "tid" integer NOT NULL, PRIMARY KEY("id"), UNIQUE("tid") ); ``` And Ive uploaded an example (trimmed down) database here https://filebin.net/ncwkgasmyau99waa