-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdd.sql
More file actions
38 lines (33 loc) · 1.38 KB
/
dd.sql
File metadata and controls
38 lines (33 loc) · 1.38 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
33
34
35
36
37
38
/****************************************************************
*
* PostgreSQL database objects data definition for fmsgid
*
****************************************************************/
-- database with encoding UTF8 should already be created and connected
create table if not exists address (
address_lower text primary key,
address text not null,
display_name text,
accepting_new bool not null default true,
limit_recv_size_total bigint not null default 102400000,
limit_recv_size_per_msg bigint not null default 10240,
limit_recv_size_per_1d bigint not null default 102400,
limit_recv_count_per_1d bigint not null default 1000,
limit_send_size_total bigint not null default 102400000,
limit_send_size_per_msg bigint not null default 10240,
limit_send_size_per_1d bigint not null default 102400,
limit_send_count_per_1d bigint not null default 1000
);
create table if not exists address_tx (
address_lower text not null references address (address_lower) ,
ts timestamptz not null,
type smallint not null, -- 1 for recv, 2 for send
size int not null,
primary key (address_lower, ts)
);
create index address_tx_addr_type_ts
on address_tx (address_lower, type, ts desc);
alter table address_tx set (
autovacuum_vacuum_scale_factor = 0.01,
autovacuum_analyze_scale_factor = 0.01
);