[Question] Can it be changed to a configurable item
Question
由于 HistoryJpaDatabaseDataStorage.MAX_HISTORY_TABLE_RECORD ( private static final int MAX_HISTORY_TABLE_RECORD = 20_000; )的限制,
使用jpa或者mysql存储数据时,最大历史条数只能有20000条。导致历史记录只能记录很短的一个时间范围,能否把这个改成可配置项,由用户决定最大条数。
hi 这里故意限制的,如果不限制存入H2数据库指标数据量,很容易因为数据库性能问题奔溃。所以我们文档都是建议大家使用配置时序数据库来存储指标数据,时序数据库无限制。
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
hi This is intentionally limited. If you do not limit the amount of index data stored in the H2 database, it is easy to crash due to database performance problems. Therefore, our documents recommend that you use the configuration time series database to store indicator data, and there is no limit to the time series database.
有猜到限制的用意。 但对于mysql来说,以当前历史表结构,百万条数据以内应该都不足以构成性能问题。20000的限制还是有点太小了。 建议是可以配置,在配置项中注明风险,让使用者谨慎更改。
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
There is an intention to guess the limit. But for mysql, with the current historical table structure, less than one million pieces of data should not be enough to constitute a performance problem. The limit of 20000 is still a bit too small. The suggestion is that it can be configured, and the risk is indicated in the configuration item, so that users can change it carefully.
嗯嗯 可以提供一个配置项啥的让用户自己配置,有兴趣实现这个贡献一波PR吗
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
Hmm, you can provide a configuration item for users to configure by themselves, are you interested in realizing this and contributing a wave of PR?
No longer applicable: the JPA history storage was replaced by DuckDB in #3883, which retains data by time (90 days by default) instead of by record count.