From 8779bb2b86496499e81666596fcde656cc0c22d4 Mon Sep 17 00:00:00 2001 From: Thomas E Lackey Date: Fri, 21 Jul 2023 13:27:26 -0500 Subject: [PATCH] Do not make eth.header_cids a hypertable. (#137) --- db/migrations/00018_convert_to_hypertables.sql | 5 ----- schema.sql | 7 ------- 2 files changed, 12 deletions(-) diff --git a/db/migrations/00018_convert_to_hypertables.sql b/db/migrations/00018_convert_to_hypertables.sql index ed38675..44f58b2 100644 --- a/db/migrations/00018_convert_to_hypertables.sql +++ b/db/migrations/00018_convert_to_hypertables.sql @@ -1,6 +1,5 @@ -- +goose Up SELECT create_hypertable('ipld.blocks', 'block_number', migrate_data => true, chunk_time_interval => 32768); -SELECT create_hypertable('eth.header_cids', 'block_number', migrate_data => true, chunk_time_interval => 32768); SELECT create_hypertable('eth.uncle_cids', 'block_number', migrate_data => true, chunk_time_interval => 32768); SELECT create_hypertable('eth.transaction_cids', 'block_number', migrate_data => true, chunk_time_interval => 32768); SELECT create_hypertable('eth.receipt_cids', 'block_number', migrate_data => true, chunk_time_interval => 32768); @@ -24,7 +23,6 @@ CREATE TABLE eth.state_cids_i (LIKE eth.state_cids INCLUDING ALL); CREATE TABLE eth.receipt_cids_i (LIKE eth.receipt_cids INCLUDING ALL); CREATE TABLE eth.transaction_cids_i (LIKE eth.transaction_cids INCLUDING ALL); CREATE TABLE eth.uncle_cids_i (LIKE eth.uncle_cids INCLUDING ALL); -CREATE TABLE eth.header_cids_i (LIKE eth.header_cids INCLUDING ALL); CREATE TABLE ipld.blocks_i (LIKE ipld.blocks INCLUDING ALL); -- migrate data @@ -34,7 +32,6 @@ INSERT INTO eth.state_cids_i (SELECT * FROM eth.state_cids); INSERT INTO eth.receipt_cids_i (SELECT * FROM eth.receipt_cids); INSERT INTO eth.transaction_cids_i (SELECT * FROM eth.transaction_cids); INSERT INTO eth.uncle_cids_i (SELECT * FROM eth.uncle_cids); -INSERT INTO eth.header_cids_i (SELECT * FROM eth.header_cids); INSERT INTO ipld.blocks_i (SELECT * FROM ipld.blocks); -- drop hypertables @@ -44,7 +41,6 @@ DROP TABLE eth.state_cids; DROP TABLE eth.receipt_cids; DROP TABLE eth.transaction_cids; DROP TABLE eth.uncle_cids; -DROP TABLE eth.header_cids; DROP TABLE ipld.blocks; -- rename new tables @@ -54,5 +50,4 @@ ALTER TABLE eth.state_cids_i RENAME TO state_cids; ALTER TABLE eth.receipt_cids_i RENAME TO receipt_cids; ALTER TABLE eth.transaction_cids_i RENAME TO transaction_cids; ALTER TABLE eth.uncle_cids_i RENAME TO uncle_cids; -ALTER TABLE eth.header_cids_i RENAME TO header_cids; ALTER TABLE ipld.blocks_i RENAME TO blocks; diff --git a/schema.sql b/schema.sql index a9cc976..5acd2e7 100644 --- a/schema.sql +++ b/schema.sql @@ -856,13 +856,6 @@ CREATE INDEX uncle_header_id_index ON eth.uncle_cids USING btree (header_id); CREATE INDEX blocks_block_number_idx ON ipld.blocks USING btree (block_number DESC); --- --- Name: header_cids ts_insert_blocker; Type: TRIGGER; Schema: eth; Owner: - --- - -CREATE TRIGGER ts_insert_blocker BEFORE INSERT ON eth.header_cids FOR EACH ROW EXECUTE FUNCTION _timescaledb_internal.insert_blocker(); - - -- -- Name: log_cids ts_insert_blocker; Type: TRIGGER; Schema: eth; Owner: - --