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?

我正在开发一个网站,这个网站利用了一个数据库,里面有一个组织表,每个组织有一行。每个组织可以有无限数量的附加关键字。关键字在一个单独的表格中表示,其中每一行仅仅是它所依附的组织的主键、关键字和主键。最终这个表可以有成千上万个条目。这是否会使从该表中提取记录以及在该表中列出惟一的关键字变得太耗时?

4 个解决方案

#1


13

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

只要:

  • they are indexed properly
  • 他们是索引正确
  • and your queries are done properly (i.e. using the right indexes, for instance)
  • 而且您的查询也得到了正确的处理(例如,使用正确的索引)

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 ^^

我工作在一个应用程序,该应用程序的几个表上做很多查询几百上千记录在每个连接,而不是“简单”where子句,和应用程序工作正常,自从我们优化查询和索引^ ^


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 :

在任何情况下,只有一种方法可以确定:

  • You have to know what kind of queries you'll be doing,
  • 你必须知道你要做什么样的查询,
  • You also have to have a large dataset to test,
  • 你还必须有一个大型数据集来测试,
  • And you have to benchmarking : launch the queries on your dataset, a lot of times, with concurrency, as if in "real conditions" -- and it'll help answer to the questions "will it handle the load ? do I have to optimize ? what are the bottlenecks ?"
  • 您还必须进行基准测试:在数据集上多次启动查询,并具有并发性,就像在“真实情况”中一样——这将有助于回答“它会处理负载吗?”我需要优化吗?什么是瓶颈?

更多相关文章

  1. 组织这种结构的最佳方式?
  2. 如何用NodeJS组织构建、服务器、客户端和共享JavaScript代码
  3. 市委组织部考核项目——多条数据的提交
  4. 你如何组织Javascript verboseness?
  5. Python:笔记(7)——yield关键字
  6. FieldErro:无法将关键字'date_added'解析为字段。选项包括:data_ad
  7. 在模块和/或包中组织Python类
  8. linux下查找包含关键字的文件
  9. SQL Server 一些关键字详解(一)

随机推荐

  1. php-fpm通过request_slowlog_timeout检查
  2. 有没有办法在php关闭标签后强制换行?>什么
  3. 让Tomcat运行PHP的几种方式
  4. php对象的实现
  5. 为什么只有ASP.NET有异步编程模型?
  6. PHP / Ajax:如何在成功登录后启动会话(剩
  7. php单引号和双引号的区别
  8. GET 与 POST 的理解
  9. php调整图像大小
  10. php exec文件从终端运行,而不是从浏览器运