wankdanker/node-odbc — pull request #11 by lee-houghton (2014-07-25 11:54:58+00:00)
Title: Always use SQLExecDirect in UV_Query.

This should work just as well as ``SQLPrepare``, but with less overhead, since ``SQLExecDirect`` uses bound parameters in the same way. As far as I can see from the documentation, ``SQLPrepare`` is intended for when you will run the same query multiple times using the same ``HSTMT`` (3 to 5 times or more is suggested), whereas ``ODBCConnection::Query`` runs the query once.

In SQL Server, at least, using ``SQLPrepare`` actually creates a temporary stored procedure in the tempdb database (http://msdn.microsoft.com/en-us/library/ms811006.aspx#code-snippet-35).

I don't think this should reduce performance in other databases, unless in that other database ``SQLPrepare`` then ``SQLExecute`` were faster than ``SQLExecDirect``, which seems unlikely. I don't currently have the setup to test this, do you have a usual way of benchmarking this stuff?