MySQL Prepared Statements
If you care about archiving best performance in your application using MySQL you should learn about prepared statements. These do not neccesary provide performance beneft but they may, they also have other benefits.
As a quick introduction - before MySQL 4.1 there were only textual statements and textual protocol for data transfer - query was sent as text and result returned back as text. For example number 123 would be sent as string “123″. Such protocol had serious performance implication - queries had to be parsed fully each time, all return values had to be converted to the strings on server side and back on the client side, which is pretty expensive especially for certain data types. Furthermore BLOBs require escaping as not all characters could be used in textual protocol, which not only consumed time but also required extra memory consumption both on server and client.











del.icio.us
digg