[odb-users] Using prefetch with Oracle

Boris Kolpackov boris at codesynthesis.com
Fri Feb 10 11:07:35 EST 2017


Hi Marco,

Marco Craveiro <marco.craveiro at gmail.com> writes:

> This is exactly what I am looking for. But I grepped the code and
> found no references to OCI_ATTR_PREFETCH_ROWS[2], so I tried manually
> hacking "execute" as follows (statement.cxx in odb-oracle):
> 
>       const int prefetchSize(5000);
>       sword r = OCIAttrSet (stmt_,
>           OCI_HTYPE_STMT,
>           (void*)&prefetchSize,
>           sizeof(int),
>           OCI_ATTR_PREFETCH_ROWS,
>           err);
> 
>       if (r == OCI_ERROR || r == OCI_INVALID_HANDLE)
>           translate_error (err, r);
> 
> Largely copied from SO[3]. This did not crash :-) but it didn't make
> any performance difference either.

Just to confirm, did you hack select_statement::execute()?

Boris



More information about the odb-users mailing list