-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlinkbench_init.sql
More file actions
32 lines (29 loc) · 1.14 KB
/
linkbench_init.sql
File metadata and controls
32 lines (29 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
create database linkdb;
use linkdb;
CREATE TABLE linktable (
id1 bigint(20) unsigned NOT NULL DEFAULT 0,
id2 bigint(20) unsigned NOT NULL DEFAULT 0,
link_type bigint(20) unsigned NOT NULL DEFAULT 0,
visibility tinyint(3) NOT NULL DEFAULT 0,
data varchar(255) NOT NULL DEFAULT '',
time bigint(20) unsigned NOT NULL DEFAULT 0,
version int(11) unsigned NOT NULL DEFAULT 0,
PRIMARY KEY (link_type, id1, id2),
KEY id1_type (id1, link_type, visibility, time, id2, version,data)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 PARTITION BY key(id1) PARTITIONS 16;
CREATE TABLE counttable (
id bigint(20) unsigned NOT NULL DEFAULT 0,
link_type bigint(20) unsigned NOT NULL DEFAULT 0,
count int(10) unsigned NOT NULL DEFAULT 0,
time bigint(20) unsigned NOT NULL DEFAULT 0,
version bigint(20) unsigned NOT NULL DEFAULT 0,
PRIMARY KEY (id, link_type)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE nodetable (
id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
type int(10) unsigned NOT NULL,
version bigint(20) unsigned NOT NULL,
time int(10) unsigned NOT NULL,
data mediumtext NOT NULL,
PRIMARY KEY(id)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;