Reverting sigature to char(88) and account key to char(44)

This commit is contained in:
godmodegalactus 2024-01-05 17:08:23 +01:00
parent 050bbbbb76
commit c8c59135f8
No known key found for this signature in database
GPG Key ID: 22DA4A30887FDA3C
2 changed files with 8 additions and 12 deletions

View File

@ -1,7 +1,7 @@
CREATE SCHEMA banking_stage_results_2; CREATE SCHEMA banking_stage_results_2;
CREATE TABLE banking_stage_results_2.transactions( CREATE TABLE banking_stage_results_2.transactions(
signature text primary key, signature char(88) primary key,
transaction_id bigserial, transaction_id bigserial,
UNIQUE(transaction_id) UNIQUE(transaction_id)
); );
@ -35,8 +35,8 @@ CREATE INDEX idx_transaction_slot_slot ON banking_stage_results_2.transaction_sl
CREATE TABLE banking_stage_results_2.blocks ( CREATE TABLE banking_stage_results_2.blocks (
slot BIGINT PRIMARY KEY, slot BIGINT PRIMARY KEY,
block_hash text, block_hash char(44),
leader_identity text, leader_identity char(44),
successful_transactions BIGINT, successful_transactions BIGINT,
processed_transactions BIGINT, processed_transactions BIGINT,
total_cu_used BIGINT, total_cu_used BIGINT,
@ -59,8 +59,6 @@ CREATE TABLE banking_stage_results_2.accounts_map_transaction(
PRIMARY KEY (transaction_id, acc_id) PRIMARY KEY (transaction_id, acc_id)
); );
ALTER TABLE banking_stage_results_2.accounts_map_transaction ADD COLUMN is_atl BOOL;
CREATE INDEX accounts_map_transaction_acc_id ON banking_stage_results_2.accounts_map_transaction(acc_id); CREATE INDEX accounts_map_transaction_acc_id ON banking_stage_results_2.accounts_map_transaction(acc_id);
CREATE INDEX accounts_map_transaction_transaction_id ON banking_stage_results_2.accounts_map_transaction(transaction_id); CREATE INDEX accounts_map_transaction_transaction_id ON banking_stage_results_2.accounts_map_transaction(transaction_id);
@ -122,8 +120,6 @@ VACUUM FULL banking_stage_results_2.blocks;
CLUSTER banking_stage_results_2.transaction_slot using idx_transaction_slot_timestamp; CLUSTER banking_stage_results_2.transaction_slot using idx_transaction_slot_timestamp;
VACUUM FULL banking_stage_results_2.transaction_slot; VACUUM FULL banking_stage_results_2.transaction_slot;
ALTER TABLE banking_stage_results_2.transactions ALTER COLUMN signature TYPE TEXT;
CLUSTER banking_stage_results_2.accounts_map_transaction using accounts_map_transaction_pkey; CLUSTER banking_stage_results_2.accounts_map_transaction using accounts_map_transaction_pkey;
CLUSTER banking_stage_results_2.transactions using transactions_pkey; CLUSTER banking_stage_results_2.transactions using transactions_pkey;

View File

@ -134,7 +134,7 @@ impl PostgresSession {
format!( format!(
r#" r#"
CREATE TEMP TABLE {}( CREATE TEMP TABLE {}(
signature text signature char(88)
); );
"#, "#,
temp_table temp_table
@ -307,8 +307,8 @@ impl PostgresSession {
.execute( .execute(
format!( format!(
"CREATE TEMP TABLE {}( "CREATE TEMP TABLE {}(
account_key text, account_key char(44),
signature text, signature char(88),
is_writable BOOL, is_writable BOOL,
is_signer BOOL, is_signer BOOL,
is_atl BOOL is_atl BOOL
@ -381,7 +381,7 @@ impl PostgresSession {
.execute( .execute(
format!( format!(
"CREATE TEMP TABLE {}( "CREATE TEMP TABLE {}(
signature text, signature char(88),
processed_slot BIGINT, processed_slot BIGINT,
is_successful BOOL, is_successful BOOL,
cu_requested BIGINT, cu_requested BIGINT,
@ -470,7 +470,7 @@ impl PostgresSession {
.execute( .execute(
format!( format!(
"CREATE TEMP TABLE {}( "CREATE TEMP TABLE {}(
account_key TEXT, account_key char(44),
slot BIGINT, slot BIGINT,
is_write_locked BOOL, is_write_locked BOOL,
total_cu_requested BIGINT, total_cu_requested BIGINT,