本文介绍了有数百万的表和数百万行在它们中MySQL数据库设计的常见做法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我正在为即将到来的网络应用程序进行数据库设计,我想知道任何人在他们当前的网络应用程序中大量使用mysql,如果这种设计对于一个网络应用程序是有效的,可以说有80,000个用户。 1 DB 在数据库中,每个用户的功能数以百万计,每个表内可能有数百万行。 / p> 虽然这个设计非常动态,体积很小,但我想知道两件事。 如果查询数百万行,这将是如何执行的。 一个数据库执行如果它包含百万个表? (再次,时间明智,这是可能的吗?) 如果它在上述条件下表现良好,如果所有80,000个用户访问DB 20-30 这需要多少服务器空间,一般来说(重申,数以百万计的表,每个表包含10到15列的可能数百万行 任何帮助。解决方案 1 - 绝对不会。几乎任何你问的人都会告诉你数以百万计的表是一个可怕的想法。 2 - 数百万的ROWS是常见的,所以很好。 3 - 可能是可怕的,,特别是如果查询是由有人认为有好几百万的表。这告诉我这是一个不太理解数据库的人。 4 - 见#3 5 - 不可能告诉。你将有额外的表额外的额外开销,因为他们都需要额外的元数据。所需的空间将取决于索引和表格的宽度,以及许多其他因素。 总之,这是一个非常非常严重的坏您不应该这样做。 I am doing database design for an upcoming web app, and I was wondering from anybody profusely using mysql in their current web apps if this sort of design is efficient for a web app for lets say 80,000 users.1 DBin DB, millions of tables for features for each user, and within each table, potentially millions of rows.While this design is very dynamic and scales nicely, I was wondering two things.Is this a common design in web applications today?How would this perform, time wise, if querying millions of rows.How does a DB perform if it contains MILLIONS of tables? (again, time wise, and is this even possible?)if it performs well under above conditions, how could it perform under strenuous load, if all 80,000 users accessed the DB 20-30 times each for 10 -15 minute sessions every day?how much server space would this require, very generally speaking (reiterating, millions of tables each containing potentially millions of rows with 10-15 columns filled with text)Any help is appreciated. 解决方案 1 - Definitely not. Almost anyone you ask will tell you millions of tables is a terrible idea.2 - Millions of ROWS is common, so just fine.3 - Probably terribly, especially if the queries are written by someone who thinks it's OK to have millions of tables. That tells me this is someone who doesn't understand databases very well.4 - See #35 - Impossible to tell. You will have a lot of extra overhead from the extra tables as they all need extra metadata. Space needed will depend on indexes and how wide the tables are, along with a lot of other factors.In short, this is a very very very seriously bad idea and you should not do it. 这篇关于有数百万的表和数百万行在它们中MySQL数据库设计的常见做法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
06-02 16:38