annotate results/cdx.sql @ 143:ddff993994be

too clever by half, keys won't work in parallel for e.g. media types
author Henry S. Thompson <ht@inf.ed.ac.uk>
date Wed, 20 Oct 2021 15:47:55 +0000
parents
children 3abcb61e0bd9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
143
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
1 -- Tables for storing index file counts
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
2 -- Keyed names for various closed-class types
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
3 CREATE TABLE scheme(
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
4 id INTEGER PRIMARY KEY NOT NULL, -- AUTOINCREMENT
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
5 name VARCHAR(16)
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
6 );
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
7 INSERT INTO scheme(name) VALUES ('http'),('https');
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
8
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
9 CREATE TABLE mpt(
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
10 id INTEGER PRIMARY KEY NOT NULL, -- AUTOINCREMENT
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
11 name VARCHAR(11)
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
12 );
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
13 INSERT INTO mpt(name) VALUES
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
14 ('text'),('image'),('audio'),('video'),('application');
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
15
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
16 CREATE TABLE mst(name)(
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
17 id INTEGER PRIMARY KEY NOT NULL, -- AUTOINCREMENT
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
18 name VARCHAR(11)
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
19 );
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
20
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
21 CREATE TABLE mediaType(
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
22 id INTEGER PRIMARY KEY NOT NULL, -- AUTOINCREMENT
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
23 pt INTEGER NOT NULL,
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
24 st INTEGER NOT NULL,
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
25 FOREIGN KEY(pt) REFERENCES mpt(id),
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
26 FOREIGN KEY(st) REFERENCES mst(id)
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
27 );
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
28
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
29 CREATE TABLE lang(
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
30 id INTEGER PRIMARY KEY NOT NULL, -- AUTOINCREMENT
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
31 code CHAR(3) NOT NULL,
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
32 fname VARCHAR
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
33 );
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
34
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
35 CREATE TABLE langs(
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
36 id INTEGER PRIMARY KEY NOT NULL, -- AUTOINCREMENT
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
37 count INTEGER NOT NULL,
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
38 primary INTEGER NOT NULL,
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
39 secondary INTEGER,
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
40 tertiary INTEGER,
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
41 FOREIGN KEY(primary) REFERENCES lang(id),
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
42 FOREIGN KEY(secondary) REFERENCES lang(id),
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
43 FOREIGN KEY(tertiary) REFERENCES lang(id)
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
44 );
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
45
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
46 CREATE TABLE props(
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
47 index INTEGER NOT NULL,
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
48 ftype CHAR(1), -- 'r', 'w', 'c'
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
49 scheme INTEGER NOT NULL,
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
50 ct INTEGER NOT NULL,
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
51 sniffed INTEGER NOT NULL,
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
52 langs INTEGER,
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
53 FOREIGN KEY(scheme) REFERENCES scheme(id),
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
54 FOREIGN KEY(ct) REFERENCES mediaType(id),
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
55 FOREIGN KEY(sniffed) REFERENCES mediaType(id),
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
56 FOREIGN KEY(langs) REFERENCES langs(id),
ddff993994be too clever by half, keys won't work in parallel for e.g. media types
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
57 );