MySQL行数过多? [英] How many MySQL rows are too many?

查看:109
本文介绍了MySQL行数过多?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在一个网站上,该网站实质上利用的是一个带有组织表的数据库,每个组织一行.每个组织可以有无限数量的附加关键字.关键字在与组织不同的表中表示,其中每行只是其附属的组织的主键,关键字和主键.最终,该表可能具有成千上万的条目.这样是否会从该表中提取记录以及在表中列出唯一的关键字,这太耗时了?

I'm working on a website that utilizes essentially a database with a table of organizations, one row for each organization. Each organization can have an unlimited number of attached keywords. The keywords are represented in a separate table from the organizations where each row is simply the primary key, the keyword, and the primary key of the organization it is attached to. Eventually this table could have many thousands of entries. Will this making pulling records from this table, as well as listing unique keywords in the table, too time consuming?

推荐答案

只要有几十万行就可以了,只要:

Having a couple of hundred thousands rows is perfectly fine, as long as :

  • 它们的索引正确
  • 并且您的查询已正确完成(例如,使用正确的索引)

我正在开发一个应用程序,该应用程序在几个表上执行大量查询,每个表中有数十万条记录,具有联接,而不是简单" where子句,并且该应用程序运行良好-很好,因为我们已经优化了查询和索引^^

I'm working on an application that's doing lots of queries on several tables with a couple of hundred thousands records in each, with joins and not "simple" where clause, and that application is working fine -- well, since we've optimized the queries and indexes ^^


在这种情况下,几百万行也是可以的,我要说的-取决于您要执行哪种类型的查询(以及其中的多少个 )^^


A couple of million rows, in those conditions, is OK too, I'd say -- depends on what kind of queries (and how many of those) you'll do ^^


在每种情况下,只有一种方法可以肯定:


In every case, there's only one way to know for sure :

  • 您必须知道要执行哪种查询,
  • 您还必须要有大量的数据集进行测试,
  • 您必须进行基准测试:并发地在数据集上多次启动查询,就好像在真实条件"下一样-并且它将有助于回答它将处理负载吗?我需要优化吗?瓶颈是什么?"

这篇关于MySQL行数过多?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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