From: Warren Young Date: July 14 2007 4:57am Subject: Re: Newbie question: very slow performance List-Archive: http://lists.mysql.com/plusplus/6791 Message-Id: <469857C7.2080502@etr-usa.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit William F. Dowling wrote: > mysqlpp::Query query = con.query(); > query << "call get_some_data(" << mysqlpp::quote > << ck << ")"; > mysqlpp::Result res = query.store(); You do realize that a store() query puts the entire result set in memory? If the result set is large, your speed hit could be due to virtual memory thrashing. If so, switch to a use() query. Read the user manual for details. > if (res) { > mysqlpp::Row row = res.at(0); // count returns one row > *result = row.at(0).get_string(); See the reference manual as of the 2.3.2 release for why get_string() is inefficient. Something more like this should do better: if (res) { mysqlpp::Row row = res.at(0); result->assign(row.raw_data(0), row.raw_size(0)); This makes a straight copy from the mysqlpp::Row innards into the std::string, no temporaries.