On Jul 8, 2011, at 3:57 AM, Bruce Adams wrote:

> So clearly the bulk idiom recommended in the documentation is the  
> best one in
> soci.
> However its not the nicest to code compared to the more basic idiom:
>
> int i;
> statement st = (sql.prepare <<
>                "select value from numbers order by value",
>                into(i));
> st.execute();
> while (st.fetch())
> {
>    cout << i << '\n';
> }
> Unfortunately that idiom gives performance comparible to BATCH_SIZE=1
> real 586.36
> user 68.76
> sys 56.17
>
> All these results are highly repeatable.
> Is there anything that can be done to achieve the performance of the  
> builk idiom
> with the basic but prettier code
> (i.e. not having to use a vector)?
> I am thinking perhaps, that the default should be for queries to be  
> buffered
> with unbuffered queries

The SOCI Oracle bulk operations support is a wrapper around the OCI  
API. OCI includes a high performance facility for retrieving or  
loading data in bulk, via arrays. SOCI simplifies the OCI interface  
considerably, but std::vectors (or similar) are needed in order to  
preserve the contiguous memory requirements of the underlying OCI API.

Stephen

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Soci-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/soci-users

Reply via email to