AdoQuery 如何处理 blob?
我正在测试一些数据库组件,例如 SDAC
等,我发现了一些有趣的事情:
当我使用 TADOQuery
执行查询并且该查询有很多 blob 字段时,我 发现了一些有趣的事情:获取所有行 (fetchall
) 我的应用程序的内存接近 1.8GB,一切正常。
使用其他组件时,在同一数据库上执行的同一查询会引发内存不足
异常,因为它超过了 1.8GB 的内存使用量。
我知道我不应该返回所有这些行,我应该使用分页和 blablabla。但我很好奇 ADO 如何设法获取所有行而其他组件却不能。
我认为 ADO 正在压缩内存中的 blob,但这只是一个猜测。
有谁知道为什么 ADO 中的内存使用率这么好?
I am testing some databases components such as SDAC
and others and I found out something interesting:
When I execute a query with TADOQuery
and this query has a lot of blob fields and I get all rows (fetchall
) the memory of my application gets close to 1.8GB and everything works fine.
Using other components, the same query executed on the same database trows an Out of Memory
exception because it exceeds 1.8GB of memory usage.
I know I should not return all those rows, i should use pagination and blablabla. But i am curious how can ADO manage to get all rows and other components cant.
I think that ADO is compressing the blobs in memory, but this is only a guess.
Does anyone knows why memory usage in ADO is so good?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不能谈论 SDAC,但会谈论 AnyDAC TADQuery:
此外,还有一些其他技术可以在获取大型结果集时减少内存使用。为了正确使用它们,开发人员应该知道将返回什么类型的数据。使用某些选项的代价可能是稍微降低获取性能。
I cannot say about SDAC, but will say about AnyDAC TADQuery:
Also there are few other techniques, allowing to reduce memory usage when fetching large result sets. To use them properly a developer should know what kind of data will be returned. The price of some options usage may be a slightly reduced fetch performance.