Improve/use text insteadof varchar char (#33)

* clippy+fmt

* use varchar for signature+account_address

* cluster amt table

* Postgres: use TEXT everywhere
This commit is contained in:
Groovie | Mango 2023-12-22 15:24:06 +01:00 committed by GitHub
parent 481c1e2d06
commit c51d8f87b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 8 deletions

View File

@ -119,4 +119,9 @@ CLUSTER banking_stage_results_2.blocks using blocks_pkey;
VACUUM FULL banking_stage_results_2.blocks;
-- optional
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;

View File

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