----- Original Message -----
> From: "Alex Schaft" <al...@quicksoftware.co.za>
> 
> 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

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql

Reply via email to