简体   繁体   English

MySQL:InnoDB或MyISAM Engine :::哪个对很多选择更好?

[英]MySQL: InnoDB or MyISAM Engine ::: which is better for lot of selects?

I have a huge file (~26 MB) with around 200 columns & 30000 records. 我有一个巨大的文件(〜26 MB),大约有200列和30000条记录。 I want to import it into a database (InnoDB Engine). 我想将其导入数据库(InnoDB Engine)。 I wont't be updating or deleting records ever. 我永远不会更新或删除记录。 ALthough I will be querying a lot of records from the table with high complexity in where clause. 尽管我将在where子句中从表中查询很多记录,但记录的复杂度很高。 Which table engine should i prefer for faster query response? 我应该选择哪种表引擎来加快查询响应速度? Will it really make a lot of difference? 真的会有很大的不同吗? PS: All my other tables use InnoDB. PS:我所有其他表都使用InnoDB。

Also How can I avoid manually creating a table with 200 columns and specifying the datatype for each of them. 另外,如何避免手动创建包含200列的表并为每个列指定数据类型。 Most of the columns are float and few are varchar and date. 大多数列都是浮点型的,很少是varchar和date。

Usually the answer to "which is faster, ISAM or innodb" would be ISAM 通常,“更快,ISAM或innodb”的答案是ISAM

But for best performance with a table which has very few updates you might want to have a look at Infobright's columnar db (which is integrated into mysql). 但是为了获得具有很少更新的表的最佳性能,您可能需要查看Infobright的列式数据库 (已集成到mysql中)。

However with only 30k rows you'll not see a significant difference between innodb, isam and infobright. 但是,只有3万行时,您看不到innodb,isam和infobright之间的显着差异。

OTOH, you really should have a long hard look at whether you really need 200 columns in a single table. OTOH,您真的应该认真考虑一下是否真的需要在单个表中包含200列。 I suspect that's not the case - and the schema is far more important in determining performance than the storage engine. 我怀疑情况并非如此-模式在确定性能方面比存储引擎重要得多。

when dealing with large amounts of data innodb fares better then myisam., 当处理大量数据时,innodb的价格要比myisam好。

http://www.mysqlperformanceblog.com/2007/01/08/innodb-vs-myisam-vs-falcon-benchmarks-part-1/ http://www.mysqlperformanceblog.com/2007/01/08/innodb-vs-myisam-vs-falcon-benchmarks-part-1/

and

http://www.cftopper.com/index.cfm?blogpostid=84 http://www.cftopper.com/index.cfm?blogpostid=84

James Day, a MySQL Support Engineer and Wikipedia engineer recommends that people use InnoDB all the time unless for some reason if becomes apparent that you need MyISAM: MySQL支持工程师和Wikipedia工程师James Day建议人们一直使用InnoDB,除非出于某种原因,如果您明显需要MyISAM:

"I'd go with InnoDB until it's been proved that it's unsuitable. The first reason is reliability. Get a crash with MyISAM and you have the unreliable and slow, related to table size, table repair process. Same thing with InnoDB and you instead get the fixed time, fast and reliable log apply/rollback process. As the data set gets bigger, this matters more and more, as it does if you want to do things like sleep instead of being woken up in the middle of the night to fix a crashed table. “在证明它不合适之前,我会选择InnoDB。第一个原因是可靠性。使用MyISAM会导致崩溃,并且与表大小,表修复过程有关,这是不可靠且缓慢的。与InnoDB相同,而您获得固定的时间,快速且可靠的日志应用/回滚过程。随着数据集的增大,这一点变得越来越重要,就像您要执行诸如睡眠之类的事情,而不是在深夜醒来,修复崩溃的表。

For reliability and performance, we use InnoDB for almost everything at Wikipedia - we just can't afford the downtime implied by MyISAM use and check table for 400GB of data when we get a crash." 为了提高可靠性和性能,我们在Wikipedia上几乎将InnoDB用于所有内容-我们承受不起MyISAM使用所隐含的停机时间,当崩溃时无法检查表中的400GB数据。”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM