From 4c12bb51dde250daeffafb256812ef53a8c1c985 Mon Sep 17 00:00:00 2001 From: CJ Cobb Date: Sat, 29 May 2021 09:52:02 -0400 Subject: [PATCH] remove books table from postgres --- reporting/Pg.cpp | 9 --------- reporting/PostgresBackend.cpp | 5 ----- reporting/PostgresBackend.h | 1 - 3 files changed, 15 deletions(-) diff --git a/reporting/Pg.cpp b/reporting/Pg.cpp index 705e820c..3742faf6 100644 --- a/reporting/Pg.cpp +++ b/reporting/Pg.cpp @@ -841,15 +841,6 @@ create table if not exists account_transactions5 partition of account_transactio create table if not exists account_transactions6 partition of account_transactions for values from (50000000) to (60000000); create table if not exists account_transactions7 partition of account_transactions for values from (60000000) to (70000000); --- Table that maps a book to a list of offers in that book. Deletes from the ledger table --- cascade here based on ledger_seq. -CREATE TABLE IF NOT EXISTS books ( - ledger_seq bigint NOT NULL, - book bytea NOT NULL, - offer_key bytea NOT NULL -); - -CREATE INDEX book_idx ON books using btree(ledger_seq, book, offer_key); CREATE TABLE IF NOT EXISTS keys ( ledger_seq bigint NOT NULL, diff --git a/reporting/PostgresBackend.cpp b/reporting/PostgresBackend.cpp index 55572ed9..a9e89422 100644 --- a/reporting/PostgresBackend.cpp +++ b/reporting/PostgresBackend.cpp @@ -643,9 +643,6 @@ PostgresBackend::doFinishWrites() const std::string keysStr = keysBuffer_.str(); if (keysStr.size()) writeConnection_.bulkInsert("keys", keysStr); - std::string booksStr = booksBuffer_.str(); - if (booksStr.size()) - writeConnection_.bulkInsert("books", booksStr); } auto res = writeConnection_("COMMIT"); if (!res || res.status() != PGRES_COMMAND_OK) @@ -658,8 +655,6 @@ PostgresBackend::doFinishWrites() const transactionsBuffer_.clear(); objectsBuffer_.str(""); objectsBuffer_.clear(); - booksBuffer_.str(""); - booksBuffer_.clear(); keysBuffer_.str(""); keysBuffer_.clear(); accountTxBuffer_.str(""); diff --git a/reporting/PostgresBackend.h b/reporting/PostgresBackend.h index d551f42d..48f46bf3 100644 --- a/reporting/PostgresBackend.h +++ b/reporting/PostgresBackend.h @@ -9,7 +9,6 @@ class PostgresBackend : public BackendInterface private: mutable size_t numRowsInObjectsBuffer_ = 0; mutable std::stringstream objectsBuffer_; - mutable std::stringstream booksBuffer_; mutable std::stringstream keysBuffer_; mutable std::stringstream transactionsBuffer_; mutable std::stringstream accountTxBuffer_;