我想用Java存储数百万个时间序列条目(长时间,双精度值)。(我们的监控系统目前将每个条目存储在一个大的mySQL表中,但性能非常差。)
有没有用java实现的时序数据库?
发布于 2011-10-07 20:30:09
由StumbleUpon?
使用
我希望在这个帖子里能看到更多的建议。
发布于 2011-11-16 20:55:45
由于错误的数据库设计,性能很差。我使用的是mysql,该表的布局如下:
+-------------+--------------------------------------+------+-----+-------------------+-----------------------------+
| Field | Type | Null | Key | Default | Extra |
+-------------+--------------------------------------+------+-----+-------------------+-----------------------------+
| fk_category | smallint(6) | NO | PRI | NULL | |
| method | enum('min','max','avg','sum','none') | NO | PRI | none | |
| time | timestamp | NO | PRI | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP |
| value | float | NO | | NULL | |
| accuracy | tinyint(1) | NO | | 0 | |
+-------------+--------------------------------------+------+-----+-------------------+-----------------------------+我的错误是索引不正确。在添加了多列主键之后,我的所有查询都非常快:
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| job | 0 | PRIMARY | 1 | fk_category | A | 18 | NULL | NULL | | BTREE | | |
| job | 0 | PRIMARY | 2 | method | A | 18 | NULL | NULL | | BTREE | | |
| job | 0 | PRIMARY | 3 | time | A | 452509710 | NULL | NULL | | BTREE | | |
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+谢谢你所有的回答!
发布于 2011-01-11 16:50:43
你可以看看KDB。它主要由金融公司用来获取市场时间序列数据。
https://stackoverflow.com/questions/4655539
复制相似问题