Re: [sqlite] does sqlite3_reset have a performance impact onqueries?

2011-11-02 Thread Igor Tandetnik
Stephan Beal sgb...@googlemail.com wrote: Also, because 'query' is-a ostringstream, you are possibly creating 2 unneeded std::string copies here and you are definitely invoking undefined behaviour with this part: sqlite3_prepare_v2(handle, query.str().c_str(), The problem is that

Re: [sqlite] does sqlite3_reset have a performance impact onqueries?

2011-11-02 Thread Stephan Beal
On Wed, Nov 2, 2011 at 12:59 PM, Igor Tandetnik itandet...@mvps.org wrote: The behavior of this fragment is in fact well defined by the C++ standard. The temporary is destroyed at the end of the full expression - basically, at the semicolon, after the function call That was also my

Re: [sqlite] does sqlite3_reset have a performance impact onqueries?

2011-11-02 Thread Stephan Beal
On Wed, Nov 2, 2011 at 1:11 PM, Stephan Beal sgb...@googlemail.com wrote: about undefined behaviour is true in that case, but i am 100% convinced that i've seen that usage cause problems before. Perhaps it was the compiler in question (one of the MSVC variants) which made the behaviour

Re: [sqlite] does sqlite3_reset have a performance impact onqueries?

2011-11-02 Thread Tal Tabakman
Thanks, FYI, while it was a bad code styling on my behalf (I just did it for showing en example) this was not my problem . creating 2 short strings does not takes 20 seconds :) also note, that when avoiding sqlite3_reset and creating new sqlite3_stmt every time (and still creating those

Re: [sqlite] does sqlite3_reset have a performance impact onqueries?

2011-11-02 Thread Black, Michael (IS)
Maybe my memory is fading but this is the first time I've heard anybody say the wrapping a BEBIN around a SELECT was needed. I'd swear it was always said it wasn't ever needed. From the docs http://www.sqlite.org/lang_transaction.html basically, any SQL command other than

Re: [sqlite] does sqlite3_reset have a performance impact onqueries?

2011-11-02 Thread Yuriy Kaminskiy
Black, Michael (IS) wrote: Maybe my memory is fading but this is the first time I've heard anybody say the wrapping a BEBIN around a SELECT was needed. I'd swear it was always said it wasn't ever needed. From the docs http://www.sqlite.org/lang_transaction.html basically, any SQL

Re: [sqlite] does sqlite3_reset have a performance impact onqueries?

2011-11-02 Thread Teg
I'd like this clarified too. I specifically don't use transactions when I'm selecting. In fact, I'll select, then start a transaction later for inserting the results. Would I be better off wrapping the whole thing in a transaction? Wednesday, November 2, 2011, 9:13:20 AM, you wrote:

Re: [sqlite] does sqlite3_reset have a performance impact onqueries?

2011-11-02 Thread Yuriy Kaminskiy
Teg wrote: I'd like this clarified too. I specifically don't use transactions when I'm selecting. In fact, I'll select, then start a transaction later for inserting the results. Would I be better off wrapping the whole thing in a transaction? Cannot be sure without looking at your

Re: [sqlite] does sqlite3_reset have a performance impact onqueries?

2011-11-02 Thread Dan Kennedy
On 11/02/2011 08:13 PM, Black, Michael (IS) wrote: Maybe my memory is fading but this is the first time I've heard anybody say the wrapping a BEBIN around a SELECT was needed. I'd swear it was always said it wasn't ever needed. From the docs http://www.sqlite.org/lang_transaction.html

Re: [sqlite] does sqlite3_reset have a performance impact onqueries?

2011-11-02 Thread Black, Michael (IS)
have a performance impact onqueries? On 11/02/2011 08:13 PM, Black, Michael (IS) wrote: Maybe my memory is fading but this is the first time I've heard anybody say the wrapping a BEBIN around a SELECT was needed. I'd swear it was always said it wasn't ever needed. From the docs http