有没有办法在occi中预取LOB数据? [英] Is there a way to prefetch LOBs data in occi?

查看:87
本文介绍了有没有办法在occi中预取LOB数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Oracle作为数据库的C ++应用程序,并试图获取具有CLOB数据类型的数千条记录.
一直在网上搜索有关如何在OCCI中预取CLOB数据类型的信息,但始终看到此消息如果LONG,LOB或不透明类型列(例如XMLType)是查询的一部分,则预取无效."

I'm working on a C++ application with Oracle as database and trying to fetch thousands of records with CLOB datatype.
Been searching the net on how to prefetch a CLOB datatype in OCCI but always see this "Prefetching is not in effect if LONG, LOB or Opaque Type columns (such as XMLType) are part of the query."

OCCI中是否有一种方法可以预取CLOB,或者是否有其他替代解决方案可以缩短花在获取CLOB数据上的时间?感谢您的帮助.

Is there a way in OCCI in order to prefetch CLOB or are there other alternative solutions to improve the time spent to fetch CLOB data? Thanks for the help.

推荐答案

有一种方法可以做到这一点,我们大量使用它来优化跨WAN的带有CLOB列的加载表

There is a way to do this and we use it heavily to optimize loading tables with CLOB columns across the WAN

与其将数据作为CLOB列获取,不如将其转换为 varchar(32767)

Instead of fetching the data as a CLOB column, convert it into a varray(16) of varchar(32767)

select clob_to_str_array(clob_column) from table_name;

OCCI将为您返回 vector<在这种情况下,为std :: string> .通过这种方法,我们将加载时间从15分钟降低到了不到10秒

OCCI will return you a vector < std::string > in this case. We brought down load times from 15 minutes to less than 10 seconds with this approach

我认为这是我有史以来最好的优化之一,但之所以这样做,是因为为时已晚,无法避免CLOB

I consider this one of my best optimizations ever, but I did this only because it was too late to avoid CLOB

这篇关于有没有办法在occi中预取LOB数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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