in reply to Re^2: Is bind useful for one-time queries and commands?
in thread Is bind useful for one-time queries and commands?

The DB2 server will execute the bind step internally if it has not already been done by the application. In other words, DB2 will intercept it's own query requests and bind them (temporarily) before actually getting the data. I don't know if or how long DB2 might cache ad hoc query requests, it's probably configurable. A cached query request would effectively eliminate the need for a bind step at all from the application side.

I have experience with DB2, but not DB2 and Perl. It's an educated guess.
  • Comment on Re^3: Is bind useful for one-time queries and commands?

Replies are listed 'Best First'.
Re^4: Is bind useful for one-time queries and commands?
by talexb (Chancellor) on May 20, 2008 at 19:10 UTC

    Update: Sorry -- I did the benchmarks wrong. Please disregard. I have updated the thread in question, in case you are interested in a more up to date benchmark.

    OK -- I've run benchmarks and found that bind doesn't slow things down at all -- my test actually ran faster with bind, which is what I should have expected. Now I'm trying to understand whether the type checking that bind_param does is really useful.

    Alex / talexb / Toronto

    "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds