tags:

views:

48

answers:

3

If prepared statements are used to only insert a single row. How much slower would it be compared to not using prepared statements?

+2  A: 

Query parsing is not the thing you should be worried about.
Learn to not to ask performance questions prematurely, but only for a reason.
And once having a reason, learn to profile your application and be concerned in the things, really affecting performance.

Col. Shrapnel
+1  A: 

It just means another round trip to the database, so the difference is minimal.

The query has to be prepared regardless of whether it's done in a separate step or when the query is executed, so by making a prepared statement out of a query that only is executed once, you are only dividing the work of parsing the query into two separate steps.

Guffa
A: 

If you insert a single row only once I suppose it does save some time not to use prepared statements. However, inserting ONE single row cannot be something you'd need to optimize.

extraneon