最适合我的需求的数据库是什么?
我目前正在使用 MS SQL Server 2008,但我不确定它是否是执行此特定任务的最佳系统。
我有一个像这样的表:
PK_ptA PK_ptB DateInserted LookupColA LookupColB ... LookupColF DataCol (ntext)
一个常见的查询是
SELECT TOP(1000000) DataCol FROM table
WHERE LookupColA=x AND LookupColD=y AND LookupColE=z
ORDER BY DateInserted DESC
该表大约有 10 亿行,每天插入 500 万行。
我对 SQL Server 的主要问题是分片或分散数据文件不太容易。此外,导出速度似乎达到每秒 1000 行(约 1MB/s),这看起来非常慢。
我遇到的另一个问题是,对于 SQL Server,如果我想添加新的 LookupCol,日志文件会急剧增长,需要大量很少使用的可用空间。
对于这个问题有明显更好的解决方案吗?
I am currently using MS SQL Server 2008 but I'm not sure it it is the best system for this particular task.
I have a single table like so:
PK_ptA PK_ptB DateInserted LookupColA LookupColB ... LookupColF DataCol (ntext)
A common query is
SELECT TOP(1000000) DataCol FROM table
WHERE LookupColA=x AND LookupColD=y AND LookupColE=z
ORDER BY DateInserted DESC
The table has about a billion rows with 5 million inserted per day.
My main problem with SQL Server is that it isn't too easy to shard or spread out the datafiles. Also, exporting seems to max out at 1000rows per second (about 1MB/s) which seems very slow.
Another problem I have is, with SQL Server, if I want to add a new LookupCol the log file grows enormously requiring a large amount of rarely used free space on tap.
Are there any obvious better solutions for this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您遇到了问题,但问题不是 SQL Server。让我也忽略你似乎有一个糟糕的桌子设计。
您应该:
这里的问题绝对不是 SQL Server,它与糟糕的表设计以及 - 可能 - 不足 - 硬件利用率不高有关。
You have a problem, and it is not SQL Server. let me also ignore that you seem to ahve a bad table design.
You should:
This problem here is definitely NOT SQL Server, it is related to bad table design AND - possibly - insufficient - badly utilized hardware.
好的,表格设计(单独答案)。 Lokup 本质上是查找表。
所以....
Value
作为字段
ValueTable
pk
ValueLookupMap table
所以,基本上,如果您添加一个查找“字段”那么您只需在 LookupTable 中创建一组条目,然后在 ValueLookupMap 中添加条目。
Ok, the table design (separate answer). Lokup are bassically lookup tables.
So....
Value
as vields
ValueTable
pk
ValueLookupMap table
So, basically, if you add a lookup "field" then you just create a set of entries in the LookupTable then add entries in the ValueLookupMap.