Hi,
Thank you for your response,
I self-host a Minio block storage on my HDD array so backing up to parquet files is just a matter of sending a temp file to S3 compatible endpoint.
If I mount an HDD array, I need to create another volume on Docker, pass the stuff through and then config tablespace from postgres console. In addition, I have a daily backup of the whole instance in the same array, so it does not make sense to pass HDD array to expand the docker volume and also backup on that array. If one in two machine die, I would like to have an intact version somewhere.
Here is my configure of compression:
class MCKRecordCandles(Base):
__tablename__ = "mck_record_candle"
id = Column(Integer, primary_key=True, nullable=False)
mck_id = Column(Integer(), ForeignKey("mck.id"))
mck = relationship("MCK", back_populates="mck_record_candle")
trade_time = Column(DateTime, nullable=False, index=True)
trade_date = Column(DateTime, nullable=False, index=True)
open_price = Column(Float, nullable=False)
close_price = Column(Float, nullable=False)
high_price = Column(Float, nullable=False)
low_price = Column(Float, nullable=False)
volume = Column(Float, nullable=False)
value = Column(Float, nullable=False)
interval = Column(String, default="1m", server_default="1m", nullable=False)
The hypertable is partition by trade_date. Default interval (7 days I believe). The ingestion speed is around 200 to 300 rows per sec for this table.
The compression is segment by mck_id (stock_id) (a foreign key to a table that hold stock information)
I only use 1 segment (although I also need to search by “interval”), but when I try segment by mck_id and interval, I get the error that interval already used for order.
Nevertheless, the more segment I use the more speed I may gain but I will also use more storage I believe.
Therefore, I believe export parquet files and save it somewhere will be the most feasible solution I have. With the current speed, I will store 1 year of data on hot access SSD.
Beside that, I also have 8 comparable hyper-tables in the same db, if it is somehow a problem.