0

Just recently I noticed the total rows in one of my tables to be a staggering 1.2 million (it might not be amusing to some of you... but yes this is my first time having see such large number of rows)

So coming back to my point, the table is called UserMaster and now using SQL Server Management Studio, when I do a simple

select * from Usermaster

it takes 25 minutes to fetch all the rows!

I know I could resort to indexes to speed up my query, but out of curiosity, is there any other way to sort this issue.... I did my googling before posting this is here and I came across the term Database Sharding which sounded quite relevant to my problem.

I mean, the way we could divide the original database into more than one, based on say, country and then changing the application code to identify which database to hit based on the country of the user so that the load gets divided and the query will in turn run faster..

Can someone suggest remedies on the same line, for my problem (if possible) ??

4

1 回答 1

1

数据库分片是一项非常费力的任务。只需创建正确的索引。这很容易,而且正是它们的用途。

分片用于跨服务器分发数据和负载。如果不需要,请添加索引。

于 2012-11-28T12:50:57.683 回答