diff --git a/exec/Main.hs b/exec/Main.hs index 9b0d9651..79c0cab4 100644 --- a/exec/Main.hs +++ b/exec/Main.hs @@ -69,6 +69,8 @@ main = do addEventsHeightNameParamsIndex logg conn addFromAccountsIndex logg conn addToAccountsIndex logg conn + addTransactionsRequestKeyIndex logg conn + addEventsRequestKeyIndex logg conn logg Info "DB Tables Initialized" let mgrSettings = mkManagerSettings (TLSSettingsSimple True False False) Nothing m <- newManager mgrSettings @@ -170,6 +172,24 @@ addToAccountsIndex = , statement = "CREATE INDEX IF NOT EXISTS transfers_to_acct_height_idx_idx ON transfers (to_acct, height desc, idx);" } +addTransactionsRequestKeyIndex :: LogFunctionIO Text -> Connection -> IO () +addTransactionsRequestKeyIndex = + addIndex + IndexCreationInfo + { + message = "Adding \"(requestkey)\" index on transactions table" + , statement = "CREATE INDEX IF NOT EXISTS transactions_requestkey_idx ON transactions (requestkey);" + } + +addEventsRequestKeyIndex :: LogFunctionIO Text -> Connection -> IO () +addEventsRequestKeyIndex = + addIndex + IndexCreationInfo + { + message = "Adding \"(requestkey)\" index on events table" + , statement = "CREATE INDEX IF NOT EXISTS events_requestkey_idx ON events (requestkey);" + } + {- λ> :main single --chain 2 --height 1487570 --service-host api.chainweb.com --p2p-host us-e3.chainweb.com --dbname chainweb-data --service-port 443 --service-https λ> :main single --chain 0 --height 1494311 --service-host api.chainweb.com --p2p-host us-e3.chainweb.com --dbname chainweb-data --service-port 443 --service-https