Is there a way to prefetch LOBs data in occi?

匆匆过客 提交于 2021-02-10 13:15:53

问题


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."

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.


回答1:


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

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 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

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



来源:https://stackoverflow.com/questions/54784447/is-there-a-way-to-prefetch-lobs-data-in-occi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!