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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
|
-- Table: public.transaction
-- DROP TABLE public.transaction;
CREATE TABLE public.transaction
(
pkid bigserial,
hash text COLLATE pg_catalog."default" NOT NULL,
type numeric,
"from" text COLLATE pg_catalog."default",
"to" text COLLATE pg_catalog."default",
amount numeric,
previous text COLLATE pg_catalog."default",
witness_list_block text COLLATE pg_catalog."default",
last_summary text COLLATE pg_catalog."default",
last_summary_block text COLLATE pg_catalog."default",
"data" text COLLATE pg_catalog."default",
exec_timestamp bigint,
signature text COLLATE pg_catalog."default",
is_free boolean,
"level" bigint,
witnessed_level bigint,
best_parent text COLLATE pg_catalog."default",
is_stable boolean,
status numeric,
is_on_mc boolean,
mci bigint,
latest_included_mci bigint,
mc_timestamp bigint,
stable_timestamp bigint,
is_shown boolean,
is_witness_account boolean,
is_witness boolean,
CONSTRAINT pkid_pkey PRIMARY KEY (pkid)
)
WITH (
OIDS = FALSE
)
TABLESPACE pg_default;
COMMENT ON COLUMN public.transaction.hash
IS '交易号';
COMMENT ON COLUMN public.transaction."from"
IS '发款方';
COMMENT ON COLUMN public.transaction."to"
IS '收款方';
COMMENT ON COLUMN public.transaction.amount
IS '余额,单位是Wei';
COMMENT ON COLUMN public.transaction.previous
IS '上一个交易号';
COMMENT ON COLUMN public.transaction.witness_list_block
IS '见证人列表Block';
COMMENT ON COLUMN public.transaction.last_summary
IS 'last_summary';
COMMENT ON COLUMN public.transaction.last_summary_block
IS 'last_summary_block';
COMMENT ON COLUMN public.transaction."data"
IS '数据';
COMMENT ON COLUMN public.transaction.exec_timestamp
IS 'exec_timestamp';
COMMENT ON COLUMN public.transaction.signature
IS '签名';
COMMENT ON COLUMN public.transaction.is_free
IS 'is_free';
COMMENT ON COLUMN public.transaction."level"
IS 'level';
COMMENT ON COLUMN public.transaction.witnessed_level
IS 'witnessed_level';
COMMENT ON COLUMN public.transaction.best_parent
IS 'best_parent';
COMMENT ON COLUMN public.transaction.is_stable
IS 'is_stable';
COMMENT ON COLUMN public.transaction.status
IS 'status';
COMMENT ON COLUMN public.transaction.is_on_mc
IS 'is_on_mc';
COMMENT ON COLUMN public.transaction.mci
IS 'mci';
COMMENT ON COLUMN public.transaction.latest_included_mci
IS 'latest_included_mci';
COMMENT ON COLUMN public.transaction.mc_timestamp
IS 'mc_timestamp';
-- Index: from_index
-- DROP INDEX public.from_index;
CREATE INDEX from_index
ON public.transaction USING btree
("from")
TABLESPACE pg_default;
COMMENT ON INDEX public.from_index
IS 'from_index';
-- Index: hash_index
-- DROP INDEX public.hash_index;
CREATE UNIQUE INDEX hash_index
ON public.transaction USING btree
(hash)
TABLESPACE pg_default;
-- Index: is_shown_index
-- DROP INDEX public.is_shown_index;
CREATE INDEX is_shown_index
ON public.transaction USING btree
(is_shown)
TABLESPACE pg_default;
-- Index: latest_transaction_index
-- DROP INDEX public.latest_transaction_index;
CREATE INDEX latest_transaction_index
ON public.transaction USING btree
(exec_timestamp, level, pkid)
TABLESPACE pg_default;
COMMENT ON INDEX public.latest_transaction_index
IS 'latest_transaction_index';
-- Index: to_index
-- DROP INDEX public.to_index;
CREATE INDEX to_index
ON public.transaction USING btree
("to")
TABLESPACE pg_default;
COMMENT ON INDEX public.to_index
IS 'to_index';
-- Index: witness_transaction_index
-- DROP INDEX public.witness_transaction_index;
CREATE INDEX witness_transaction_index
ON public.transaction USING btree
(exec_timestamp, level, pkid)
TABLESPACE pg_default WHERE type = 1::numeric
;
COMMENT ON INDEX public.witness_transaction_index
IS 'witness_transaction_index, exec_timestamp desc, level desc, pkid desc';
|