c++ - OCI Prefetch not working -
we have application using oci, cannot seem make prefetch working.
we have select query on table dozen of columns (amongst 1 clob column , 1 mdsys.geometry
column). clob column in 99% of cases smaller 4000 bytes , in 50% of cases empty.
process follows:
- we set
oci_attr_prefetch_rows
500 - we bind columns output buffers, clob bind directly text buffer of 8000 bytes
- for clob handle, set
oci_attr_lobprefetch_size
8000 - we use
ocistmtexecute
iters 1 one row fetched buffer.
now if wireshark see network packets never filled (there 1 record per roundtrip).
if execute same select query sqldeveloper packets nicely filled, can assume row prefetching should work.
what missing here?
since ran same problem recently: oci_attr_prefetch_rows
, oci_attr_lobprefetch_size
don't work together.
from oracle docs:
prefetching not in effect if long, lob or opaque type columns (such xmltype) part of query.
whenever have lobs in result set, can't use implicit prefetching via oci_attr_prefetch_rows , instead need use explicit row-fetching calling ocistmtfetch2() rowcount > 1. of course need setup buffers in advance, keep track of consumed rows , need call ocidefinearrayofstruct() inform oracle buffer layout.
Comments
Post a Comment