I am looking at storing some JMX data from JVMs on many servers for about 90 days. This data would be statistics like heap size and thread count. This will mean that one of the tables will have around 388 million records.

我正在研究将一些来自jvm的JMX数据在许多服务器上存储大约90天。这些数据将是统计数据,如堆大小和线程计数。这将意味着其中一个表将有大约3.88亿的记录。

From this data I am building some graphs so you can compare the stats retrieved from the Mbeans. This means I will be grabbing some data at an interval using timestamps.

从这些数据中,我构建了一些图表,以便您可以比较从mbean中检索到的统计数据。这意味着我将使用时间戳以间隔获取一些数据。

So the real question is, Is there anyway to optimize the table or query so you can perform these queries in a reasonable amount of time?

所以真正的问题是,是否存在优化表或查询的方法,以便在合理的时间内执行这些查询?

Thanks,

谢谢,

Josh

杰克

6 个解决方案

#1


9

There are several things you can do:

你可以做以下几件事:

  1. Build your indexes to match the queries you are running. Run EXPLAIN to see the types of queries that are run and make sure that they all use an index where possible.

    构建索引以匹配正在运行的查询。运行EXPLAIN查看正在运行的查询类型,并确保它们在可能的情况下都使用索引。

  2. Partition your table. Paritioning is a technique for splitting a large table into several smaller ones by a specific (aggregate) key. MySQL supports this internally from ver. 5.1.

    分区表。pari是一种将大的表分解成几个较小的表的技术,通过一个特定的(聚合)键。MySQL内部支持这一点。5.1。

  3. If necessary, build summary tables that cache the costlier parts of your queries. Then run your queries against the summary tables. Similarly, temporary in-memory tables can be used to store a simplified view of your table as a pre-processing stage.

    如果需要,构建用于缓存查询中更昂贵部分的汇总表。然后对汇总表运行查询。类似地,可以使用内存中的临时表将表的简化视图存储为预处理阶段。

更多相关文章

  1. MySQL数据库root账户的设置和管理
  2. JSON保存在数据库中并使用JQuery加载
  3. MySQL数据库表名、列名、别名区分大小写的问题
  4. Android应用程序与外部数据库之间的安全性
  5. Linux下mysql数据库root无法登录的情况
  6. 在MySQL中将数据从LATIN1转换为UTF8
  7. 版本5及更高版本中MySQL数据库的最大大小是多少?
  8. 在Google Cloud Platform上设计PolyGlot数据库
  9. MySql_数据库触发器的使用

随机推荐

  1. 对多维数组中的列进行排序
  2. 如何调用另一个函数内的函数?
  3. 如何在onchange()事件后调用的方法中将焦点
  4. 在角JS中Bootstrapping是什么意思?
  5. 动态左侧的GreenSock javascript动画
  6. 使用HTML或Javascript替换网页上的文本
  7. 父范围中的变量不会在匿名函数中被更改[
  8. 如何避免pro拖拉机中的“jasmin .suite()
  9. 如何验证一个大表格
  10. 在迭代完成之前,回调会触发