适用于大型日志表的MySQL存储引擎 [英] MySQL storage engine for a large log table

查看:383
本文介绍了适用于大型日志表的MySQL存储引擎的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

(我见过这个问题,但它不够具体我想问什么.)

(I've seen this question but it's not specific enough for what I want to ask.)

我正在建立一个大型记录(约100 GB左右)的日志表,其平均记录大小为100-200字节,并带有多个索引(索引?).插入速度约为每秒100-200条记录.我将在此表上运行分析查询,可能不是所有查询都能找到合适的索引,因此它们可能运行很长时间并查找大量数据.

I'm setting up a large-ish (a hundred GB or so) log table with an average record size of 100-200 bytes and several indexes (indices?). Insertion rate will be about 100-200 records per second. I will run analytical queries on this table, probably not all of them will hit a suitable index so they might run for a long time and look up a lot of data.

  1. 您会建议使用哪种存储引擎? (基本上是MyISAM与InnoDB.)
  2. 如果使用MyISAM,长查询会阻止插入吗?
  3. 表的大小是一个问题(不是很大,但是仍然).在这方面,一个引擎比另一个引擎效率更高吗?
  4. 在性能方面,如何比较?
  5. 在这种情况下,我还有什么要注意的吗?

推荐答案

如果您使用INSERT和UPDATE,则高性能比MyISAM使用InnoDB更好. 如果在INSERT/UPDATE使用MyISAM之前使用更多的SELECT语句. InnoDB支持ACID(原子性,一致性,隔离性和持久性),因此SELECT和JOIN越慢,但INSERT越快.

if you use INSERT and UPDATE high performance uses InnoDB over MyISAM is better. and if you use more SELECT statements before the INSERT / UPDATE uses MyISAM. The InnoDB has support with ACID (Atomicity, Consistency, Isolation and Durability) therefore the more SELECT and JOIN is slower but is faster for INSERT.

EYE:如果您需要交易这样的支付网关,则应该使用InnoDB具有交易支持的

EYE: If you need to transact such a payment gateway, you should use InnoDB has transaction support

这篇关于适用于大型日志表的MySQL存储引擎的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆