简体   繁体   English

SQL Server负担得起多少数据?

[英]How many data did SQL Server affordable?

DB: SQL Server 2014 Standard or higher; DB:SQL Server 2014 Standard或更高版本;

Server: MS Azure, no limited CPU and RAM 服务器:MS Azure,无限制的CPU和RAM

We want to design our new back-end architecture, we having approximately 20 millions in a single table, the SQL may like: 我们要设计新的后端体系结构,我们在一个表中大约有2000万,SQL可能喜欢:

select * from xxxx
where (type=1 or type=2 or type=3) and someNumber<5000
order by xxxxxx

The SQL no any relation to other tables. SQL与其他表没有任何关系。 Did this SQL can response immediately? 此SQL是否可以立即响应? (in 500 to 1000 ms) (在500到1000毫秒内)

When data grown up to 100 millions, can it still affordable? 当数据增长到1亿时,它还能负担得起吗?

Or there are some skill to optimize it? 还是有一些技巧可以优化它? (like sql view, cache...etc) (如sql视图,缓存...等)

SQL Azure should be good for you. SQL Azure应该对您有益。 I have had databases on SQL Azure with over 250 million records in a single table that was a Standard 2 tier database which is not very expensive. 我在SQL Azure上有一个数据库,在一个表中有超过2.5亿条记录,这是一个标准2层数据库,价格不是很高。 If you have good indexes and simple queries it will work fine. 如果您有良好的索引和简单的查询,它将可以正常工作。 Ultimately you should create a database and just give it a try. 最终,您应该创建一个数据库,然后尝试一下。

You can also use table partitioning which could help some with performance and management of such a large table. 您还可以使用表分区,这可以帮助某些人改进和管理如此大的表。

At Stackify we manage over 1,000 databases on SQL Azure for our multi-tenant SaaS product. 在Stackify,我们在SQL Azure上为多租户SaaS产品管理着1,000多个数据库。

You query can be more easily written as: 您的查询可以更容易地写为:

select *
from xxxx
where type in (1, 2, 3) and someNumber < 5000
order by xxxxxx;

This is hard to optimize. 这很难优化。 You can try an index on xxxx(type, someNumber) . 您可以尝试在xxxx(type, someNumber)上建立索引。 This index would work better on this verison of the query: 此索引将在查询的以下版本上更好地工作:

select *
from ((select * from xxxx where type = 1 and somenumber < 5000) union all
      (select * from xxxx where type = 2 and somenumber < 5000) union all
      (select * from xxxx where type = 2 and somenumber < 5000)
     ) x
order by xxxxxx;

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

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