处理十亿条记录的推荐数据库类型

发布于 2024-12-02 20:21:20 字数 580 浏览 1 评论 0原文

我开始参与一个项目,该项目必须重用 Microsoft SQL Server 2008 旧数据库,该数据库的表包含超过 7,000,000 条记录。

最后几分钟对该表的查询,我想知道是否使用不同类型的数据库(即非关系数据库)可以更好地处理这个问题。

你有什么建议吗?无论如何,有没有办法提高关系数据库的性能呢?

谢谢

更新:

我正在使用 Navicat 来执行这个简单的查询:

SELECT DISTINCT [NROCAJA]
FROM [CAJASE]

所以复杂的东西和子查询不是问题。我还想知道是否缺少索引是问题所在,但该表似乎已建立索引:

Index description of CAJASE table

史诗般的失败:

数据库位于远程服务器中!查询实际上需要 5 秒(我仍然认为这是很多时间,但现在问题不同了)。 99%的时间都是网络传输。不管怎样,谢谢你的回答:)

I started to work in a project which must reuse a Microsoft SQL Server 2008 old database that has a table with more than 7,000,000 records.

Queries to that table last minutes and I was wondering if a different type of database (i.e. not relational) would be better to handle this.

What do you recommend? In any case, is there a way to improve the performance of a relational database?

Thanks

UPDATE:

I am using Navicat to perform this simple query:

SELECT DISTINCT [NROCAJA]
FROM [CAJASE]

so complex stuff and subqueries are not a problem. I was also wondering if a lack of indexes was the problem, but the table seems to be indexed:

Index description of CAJASE table

EPIC FAIL:

The database was in a remote server!! The query actually takes 5 seconds (I still think it's much time, but now the issue is different). 99% of elapsed time was network transfer. Thanks for your answers anyway :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

埖埖迣鎅 2024-12-09 20:21:20

700万是SQL Server的一个小型数据库,通过适当的设计,它可以轻松处理TB级数据。可能您的设计很差,索引缺失,硬件很差,查询性能很差。不要将数据库开发人员的无能归咎于 SQL Server。

7 million is a tiny database for SQL Server, it easily handles terrabytes of data with proper design. Likely you have a poor design combined with missing indexes combined with poor hardware, combined with badly performing queries. Don't blame the incompetence of your database developers on SQL Server.

无法回应 2024-12-09 20:21:20

分析您的查询 - 700 万条记录并不是一个很大的数字,因此您很可能会丢失索引或执行复杂的子查询,而这些子查询的性能随着数据集的扩展而表现不佳。

我认为您还不需要重新构建整个系统。

Profile your queries - 7 million records isn't that great a number, so chances are you're missing an index or performing complex sub-queries that are not performing well as the dataset scales.

I don't think you need to re-architect the entire system yet.

百善笑为先 2024-12-09 20:21:20

您选择“不同”的事实可能是一个问题。也许将这些不同的值移到它自己的表中以避免重复。

The fact that you are selecting "distinct" could be a problem. Maybe move those distinct value into it's own table to avoid duplication.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文