List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:September 14 2010 10:24pm
Subject:Re: Get the number of rows with a "used" query.
View as plain text  
Please keep your replies on the list.

> As a simple workaround could you just do a "SELECT COUNT(*) FROM"
> query first if you really need to know how many rows are being
> returned.
>  
> That exactly what I did !
> Problem was : by making a "select count(*) from (myquery) as t" , before  actually
> using the query, double the global amount of time for the query ...

It shouldn't double the processing time.  First, there's less IPC I/O to return just a
count than the millions of rows.  Second, if your WHERE clause columns are all indexed,
the DB server can answer the COUNT() query without even scanning the tables, just by
looking at the indexes.
Thread
Get the number of rows with a "used" query.m p14 Sep
  • Re: Get the number of rows with a "used" query.Warren Young14 Sep
Re: Get the number of rows with a "used" query.Warren Young15 Sep