From: Warren Young Date: August 18 2006 6:40pm Subject: Re: how to optimize the query that returns only one result List-Archive: http://lists.mysql.com/plusplus/5883 Message-Id: <44E609BA.1040600@etr-usa.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit owen nirvana wrote: > for results , we access it using iterators usually. > But in case we will get one result apparently, we hope to directly > access data. > is it possible? Have you profiled the code? If not, how do you know that such an optimization will even help? In virtually all situations, the speed bottleneck is either I/O (network, disk...) or the database itself. Unless you have a very unusual situation, speeding up MySQL++ should only help significanly if there is a massive inefficiency in the library somewhere. The only such inefficiency I'm aware of is that it copies data too many times, but that only matters for large result sets, not small ones like what you're talking about.