From: Warren Young Date: December 19 2008 1:17am Subject: Re: about template query .. List-Archive: http://lists.mysql.com/plusplus/8287 Message-Id: <494AF629.6040602@etr-usa.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit soryu Jeong wrote: > > and at the moment, I have another question about template query. > > what is better performance query? template query or normal query ? > > or is there no performance difference ? Please keep replies on the list. It may be possible to measure a processing difference on the local CPU between the various query types, but all of them will execute on the MySQL server in the same amount of time. Network and disk I/O overhead between your program and the DB server should swamp any such differences. The only way to speed up a MySQL query by changing the query type would be to use prepared statements. This reduces the SQL parsing time in the DB server, so it helps when you repeat the same form of query frequently. MySQL++ currently has no special support for prepared statements. Prepared statements are superficially similar to template queries, though they work very differently under the hood. I think it may be possible to abstract away the difference between these two mechanisms, so you build and use a prepared statement the same way as you currently do with template queries. For now that's just a Wishlist item.