use BIGINT not NUMERIC, it is faster for arithmetic operations and uses less space
This commit is contained in:
parent
86ccdcd7e7
commit
4392505b16
@ -5,15 +5,15 @@ CREATE TABLE eth.header_cids (
|
|||||||
parent_hash VARCHAR(66) NOT NULL,
|
parent_hash VARCHAR(66) NOT NULL,
|
||||||
cid TEXT NOT NULL,
|
cid TEXT NOT NULL,
|
||||||
mh_key TEXT NOT NULL REFERENCES public.blocks (key) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED,
|
mh_key TEXT NOT NULL REFERENCES public.blocks (key) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED,
|
||||||
td NUMERIC NOT NULL,
|
td BIGINT NOT NULL,
|
||||||
node_id VARCHAR(128) NOT NULL REFERENCES nodes (node_id) ON DELETE CASCADE,
|
node_id VARCHAR(128) NOT NULL REFERENCES nodes (node_id) ON DELETE CASCADE,
|
||||||
reward NUMERIC NOT NULL,
|
reward BIGINT NOT NULL,
|
||||||
state_root VARCHAR(66) NOT NULL,
|
state_root VARCHAR(66) NOT NULL,
|
||||||
tx_root VARCHAR(66) NOT NULL,
|
tx_root VARCHAR(66) NOT NULL,
|
||||||
receipt_root VARCHAR(66) NOT NULL,
|
receipt_root VARCHAR(66) NOT NULL,
|
||||||
uncle_root VARCHAR(66) NOT NULL,
|
uncle_root VARCHAR(66) NOT NULL,
|
||||||
bloom BYTEA NOT NULL,
|
bloom BYTEA NOT NULL,
|
||||||
timestamp NUMERIC NOT NULL,
|
timestamp BIGINT NOT NULL,
|
||||||
times_validated INTEGER NOT NULL DEFAULT 1,
|
times_validated INTEGER NOT NULL DEFAULT 1,
|
||||||
base_fee BIGINT
|
base_fee BIGINT
|
||||||
);
|
);
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
CREATE TABLE eth.state_accounts (
|
CREATE TABLE eth.state_accounts (
|
||||||
header_id VARCHAR(66) NOT NULL,
|
header_id VARCHAR(66) NOT NULL,
|
||||||
state_path BYTEA NOT NULL,
|
state_path BYTEA NOT NULL,
|
||||||
balance NUMERIC NOT NULL,
|
balance BIGINT NOT NULL,
|
||||||
nonce INTEGER NOT NULL,
|
nonce INTEGER NOT NULL,
|
||||||
code_hash BYTEA NOT NULL,
|
code_hash BYTEA NOT NULL,
|
||||||
storage_root VARCHAR(66) NOT NULL,
|
storage_root VARCHAR(66) NOT NULL,
|
||||||
|
@ -5,15 +5,15 @@ CREATE TABLE eth.header_cids (
|
|||||||
parent_hash VARCHAR(66) NOT NULL,
|
parent_hash VARCHAR(66) NOT NULL,
|
||||||
cid TEXT NOT NULL,
|
cid TEXT NOT NULL,
|
||||||
mh_key TEXT NOT NULL,
|
mh_key TEXT NOT NULL,
|
||||||
td NUMERIC NOT NULL,
|
td BIGINT NOT NULL,
|
||||||
node_id VARCHAR(128) NOT NULL,
|
node_id VARCHAR(128) NOT NULL,
|
||||||
reward NUMERIC NOT NULL,
|
reward BIGINT NOT NULL,
|
||||||
state_root VARCHAR(66) NOT NULL,
|
state_root VARCHAR(66) NOT NULL,
|
||||||
tx_root VARCHAR(66) NOT NULL,
|
tx_root VARCHAR(66) NOT NULL,
|
||||||
receipt_root VARCHAR(66) NOT NULL,
|
receipt_root VARCHAR(66) NOT NULL,
|
||||||
uncle_root VARCHAR(66) NOT NULL,
|
uncle_root VARCHAR(66) NOT NULL,
|
||||||
bloom BYTEA NOT NULL,
|
bloom BYTEA NOT NULL,
|
||||||
timestamp NUMERIC NOT NULL,
|
timestamp BIGINT NOT NULL,
|
||||||
times_validated INTEGER NOT NULL DEFAULT 1,
|
times_validated INTEGER NOT NULL DEFAULT 1,
|
||||||
base_fee BIGINT
|
base_fee BIGINT
|
||||||
);
|
);
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
CREATE TABLE eth.state_accounts (
|
CREATE TABLE eth.state_accounts (
|
||||||
header_id VARCHAR(66) NOT NULL,
|
header_id VARCHAR(66) NOT NULL,
|
||||||
state_path BYTEA NOT NULL,
|
state_path BYTEA NOT NULL,
|
||||||
balance NUMERIC NOT NULL,
|
balance BIGINT NOT NULL,
|
||||||
nonce INTEGER NOT NULL,
|
nonce INTEGER NOT NULL,
|
||||||
code_hash BYTEA NOT NULL,
|
code_hash BYTEA NOT NULL,
|
||||||
storage_root VARCHAR(66) NOT NULL
|
storage_root VARCHAR(66) NOT NULL
|
||||||
|
@ -37,15 +37,15 @@ CREATE TABLE eth.header_cids (
|
|||||||
parent_hash character varying(66) NOT NULL,
|
parent_hash character varying(66) NOT NULL,
|
||||||
cid text NOT NULL,
|
cid text NOT NULL,
|
||||||
mh_key text NOT NULL,
|
mh_key text NOT NULL,
|
||||||
td numeric NOT NULL,
|
td bigint NOT NULL,
|
||||||
node_id character varying(128) NOT NULL,
|
node_id character varying(128) NOT NULL,
|
||||||
reward numeric NOT NULL,
|
reward bigint NOT NULL,
|
||||||
state_root character varying(66) NOT NULL,
|
state_root character varying(66) NOT NULL,
|
||||||
tx_root character varying(66) NOT NULL,
|
tx_root character varying(66) NOT NULL,
|
||||||
receipt_root character varying(66) NOT NULL,
|
receipt_root character varying(66) NOT NULL,
|
||||||
uncle_root character varying(66) NOT NULL,
|
uncle_root character varying(66) NOT NULL,
|
||||||
bloom bytea NOT NULL,
|
bloom bytea NOT NULL,
|
||||||
"timestamp" numeric NOT NULL,
|
"timestamp" bigint NOT NULL,
|
||||||
times_validated integer DEFAULT 1 NOT NULL,
|
times_validated integer DEFAULT 1 NOT NULL,
|
||||||
base_fee bigint
|
base_fee bigint
|
||||||
);
|
);
|
||||||
@ -265,7 +265,7 @@ CREATE TABLE eth.receipt_cids (
|
|||||||
CREATE TABLE eth.state_accounts (
|
CREATE TABLE eth.state_accounts (
|
||||||
header_id character varying(66) NOT NULL,
|
header_id character varying(66) NOT NULL,
|
||||||
state_path bytea NOT NULL,
|
state_path bytea NOT NULL,
|
||||||
balance numeric NOT NULL,
|
balance bigint NOT NULL,
|
||||||
nonce integer NOT NULL,
|
nonce integer NOT NULL,
|
||||||
code_hash bytea NOT NULL,
|
code_hash bytea NOT NULL,
|
||||||
storage_root character varying(66) NOT NULL
|
storage_root character varying(66) NOT NULL
|
||||||
|
Loading…
Reference in New Issue
Block a user