List:General Discussion« Previous MessageNext Message »
From:Alex Schaft Date:February 9 2012 7:37am
Subject:C api mysql_store_result vs mysql_use_result
View as plain text  
Hi,

I'm currently using mysql_store_result to retrieve all records of a 
query. This poses a problem however if say a couple of thousand records 
get returned, and the user gets no feedback during the progress. I now 
want to change this to mysql_use_result. The only catch is that you 
don't know how many records you're going to get and allocating memory 
for them.

If I were to do a select count(*) from x where y prior to doing select * 
from x where y to get a number of records, how would this impact 
performance on the server itself? Would the first query be the one to do 
the most processing, with the second one being faster, or would both 
have to do the same amount of work?

Thanks,
Alex


Thread
C api mysql_store_result vs mysql_use_resultAlex Schaft9 Feb
  • Re: C api mysql_store_result vs mysql_use_resultJohan De Meersman9 Feb
    • Re: C api mysql_store_result vs mysql_use_resultAlex Schaft9 Feb
      • Re: C api mysql_store_result vs mysql_use_resultJohan De Meersman9 Feb