signum-node icon indicating copy to clipboard operation
signum-node copied to clipboard

Activate trimming for bid_order and ask_order tables

Open frankTheTank72 opened this issue 3 years ago • 0 comments

The tables bid_order and ask_order have the same concept as all derived tables with the latest column, but those tables are not trimmed if the DB.trimDerivedTables = on is set in the config for the node.

The concept is simple - active orders have latest = 1 on the newest entry and cancelled orders or filled orders stay with all records on latest = 0 in the table.

We can remove those entries. Currently we have 32MB of data in those tables which could be freed.

Code-Hint : https://github.com/signum-network/signum-node/blob/fd497c6b8c065166e7d78c0faa488e3e2fc2ddfa/src/brs/db/sql/DerivedSqlTable.java#L22

frankTheTank72 avatar Oct 04 '22 18:10 frankTheTank72