-
Notifications
You must be signed in to change notification settings - Fork 0
/
ddl.sql
49 lines (44 loc) · 1.21 KB
/
ddl.sql
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
CREATE TABLE visitor
(
visitor_id integer UNIQUE NOT NULL
, visitor_name1 varchar(32)
, visitor_name2 varchar(32)
, visitor_name1ka varchar(32)
, visitor_name2ka varchar(32)
, visitor_lccode varchar(8) NOT NULL
, PRIMARY KEY
(
visitor_id
)
);
CREATE TABLE mailhistory
(
mailhistory_id integer NOT NULL
, visitor_id integer NOT NULL
, title varchar(64)
, opendate_first TIMESTAMP
, PRIMARY KEY
(
mailhistory_id
)
);
CREATE TABLE trackinghistory
(
trackinghistory_id integer NOT NULL
, visitor_id integer NOT NULL
, title varchar(64)
, create_date TIMESTAMP
, PRIMARY KEY
(
trackinghistory_id
)
);
-- stored procedures
CREATE PROCEDURE FROM CLASS com.kzhirata.volt.procedure.VisitorMailHistory;
CREATE PROCEDURE FROM CLASS com.kzhirata.volt.procedure.VisitorTrackingHistory;
PARTITION TABLE visitor ON COLUMN visitor_id;
--PARTITION TABLE mailhistory ON COLUMN visitor_id;
--PARTITION TABLE trackinghistory ON COLUMN visitor_id;
CREATE INDEX v_lccode ON visitor (visitor_lccode);
CREATE INDEX mv_id ON mailhistory (visitor_id);
CREATE INDEX tv_id ON trackinghistory (visitor_id);