性能改进-提取Blob记录 [英] performance improvment - Extracting Blob Records

查看:60
本文介绍了性能改进-提取Blob记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想使用某些.net实用程序提取3,000,000个Blob数据.我已经使用C#.net完成了一个示例实用程序,但是它要花费大量时间来提取所有数据.它花费超过10小时.请帮助解决此问题.

谢谢,
Senthil

Hi,

I want to extract 3,00,000 of blob data using some .net utility. I have done one sample utility using C#.net, but its taking huge time to extract all the data. Its taking more that 10Hrs. Pls help to solve this issue.

Thanks,
Senthil

推荐答案

没有相关的代码片段,就不可能很精确.但是,我的猜测是,您正在从数据库中读取所有记录,然后仅使用您感兴趣的记录-除非您使用信号量而不是网络电缆,否则单个3Mb查询不可能花费十多个小时.
检查您的SELECT查询:确保WHERE子句将返回的记录限制为仅对您感兴趣的记录.并确保它仅返回要使用的列:不要使用SELECT * FROM ....
如果不确定,请修改SELECT以仅返回小的字段(而不是BLOB字段),然后查看返回的字段.
Without relevant code fragments it is not possible to be exact. However, my guess is that you are reading all the records from the database and then just using the one you are interested in - there is no way that a single 3Mb query should take over ten hours unless you are using semaphore instead of network cable.
Check you SELECT query: make sure that the WHERE clause restricts the returned records to just the one you are interested in. And make sure that it returns only the columns you are going to use: do not use SELECT * FROM ....
If you aren''t sure, modify your SELECT to return only small fields (not the BLOB field) and see how many it returns.


在CP上找到了很久以前讨论过的内容: Performance-tip-on-extracting-BLOB-from-database.aspx [ ^ ]

还有一些进行BLOBS的利弊 http://devtoolshed.com/content/c-storeretrieve-file-database-image-field-using-odbc [
Found something on CP discussed on long ago: Performance-tip-on-extracting-BLOB-from-database.aspx[^]

Also some pros and cons of doing BLOBS http://devtoolshed.com/content/c-storeretrieve-file-database-image-field-using-odbc[^]

I personally would only store the string paths of files in the DB rather than storing the bulky files in bytes and read that path to manipulate the files.


这篇关于性能改进-提取Blob记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆