Subject | Re: [firebird-support] Is ESQL Faster than Dynamic SQL. |
---|---|
Author | Milan Babuskov |
Post date | 2007-07-17T17:06:49Z |
inoffensive_2006 wrote:
everything as strings? IOW, are you doing:
st->Prepare("insert into t1 values (?,?)");
st->Set(1, "this1");
st->Set(2, "that1");
st->Execute();
st->Set(1, "this2");
st->Set(2, "that2");
st->Execute();
or you are doing this:
st->Prepare("insert into t1 values ('this1','that1')");
st->Execute();
st->Prepare("insert into t1 values ('this2','that2')");
st->Execute();
The former one is much faster.
be my latter example?
some function calls, IBPP is a very light wrapper. I don't think the
difference would be noticeable.
--
Milan Babuskov
http://fbexport.sourceforge.net
> I've been using dynamic SQL to build my SQL in C++ stringsWhat does this mean exactly? Are you using parameters, or write
everything as strings? IOW, are you doing:
st->Prepare("insert into t1 values (?,?)");
st->Set(1, "this1");
st->Set(2, "that1");
st->Execute();
st->Set(1, "this2");
st->Set(2, "that2");
st->Execute();
or you are doing this:
st->Prepare("insert into t1 values ('this1','that1')");
st->Execute();
st->Prepare("insert into t1 values ('this2','that2')");
st->Execute();
The former one is much faster.
> and passing them to Firebird through IBPP's facilities. ThisMy example used INSERTs, but the same thing works for selected.
> has been working well, but I'm looking to speed up performance.
> In particular, we want to speed up SELECTS.
> My partner and friend in this project tells me that usingI assume that 'static SQL' is my former example, and 'dynamic SQL' would
> static SQL will improve performance of the SELECTS.
be my latter example?
> I use IBPP's Prepare() and Execute(). Then I call Fetch()This sounds correct. Care to post some actuall code?
> for each record.
> Would replacing this dynamic SQL with ESQL provide aYou mean, use ESQL instead of IBPP. While I guess it could spare you
> performance advantage?
some function calls, IBPP is a very light wrapper. I don't think the
difference would be noticeable.
--
Milan Babuskov
http://fbexport.sourceforge.net