List:General Discussion« Previous MessageNext Message »
From:Johan De Meersman Date:February 9 2012 11:40am
Subject:Re: C api mysql_store_result vs mysql_use_result
View as plain text  
----- Original Message -----
> From: "Alex Schaft" <alexs@stripped>
> 
> 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?

Heh. The amount of work put into parsing and executing would be the same, except if you
can compose your count query to use only indexed fields.

Easily checked with an explain of both queries, I'd say.

Also, do consider if you really need a %complete progress indicator, or if a simple record
counter with no indicated endpoint will do. That is, do your users need to know how long
it's going to take, or do they just want assurance that the process didn't hang?


-- 
Bier met grenadyn
Is als mosterd by den wyn
Sy die't drinkt, is eene kwezel
Hy die't drinkt, is ras een ezel
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