简体   繁体   English

对表中的数百万条记录进行分区或索引编制?

[英]Partitioning or Indexing for millions of records in a table?

I have a table containing 20+ millions(will go to 60+ within month) of records. 我有一个包含20+百万(将在一个月内达到60+)记录的表。 Now I have to fetch records very fast. 现在,我必须非常快地获取记录。

I am using MyISAM engine and i don't want to create problem during insertion(heard indexing can hurt insertion) of records. 我正在使用MyISAM引擎,并且我不想在记录的插入过程中创建问题(听到索引会伤及插入)。 So please tell me which is better indexing or partitioning. 因此,请告诉我哪种索引或分区更好。

What other factors(cache or buffering) i should use. 我应该使用什么其他因素(缓存或缓冲)。 Please let me know with example if possible. 如果可能的话,请通过示例告诉我。

Thank you 谢谢

Indexing vs. Partitioning is not a 'What's better' question because they aim to solve different problems. 索引与分区并不是一个“更好的问题”,因为它们旨在解决不同的问题。 Indexing is primarily a performance feature while partitioning is primarily a management feature (to make it easier to administer big databases). 索引主要是性能功能,而分区主要是管理功能(使管理大型数据库更容易)。

However, there is an overlap as partitioning can also improve performance in some use cases—but not in general, just in some cases. 但是,存在重叠之处,因为在某些用例中分区也可以提高性能,但在某些情况下通常不能。 Badly partitioned table can also hurt performance—just like badly designed indexes can. 分区表不好也会损害性能-就像设计不好的索引一样。

If you'd like an answer that helps you further you'd need to explain your use case in detail. 如果您希望得到一个可以帮助您进一步解决问题的答案,则需要详细说明您的用例。

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

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