From: Warren Young Date: September 14 2010 10:24pm Subject: Re: Get the number of rows with a "used" query. List-Archive: http://lists.mysql.com/plusplus/9048 Message-Id: <892705FD-FE8F-424F-ABA6-BFA6B0EA49C2@etr-usa.com> MIME-Version: 1.0 (Apple Message framework v1081) Content-Type: multipart/alternative; boundary=Apple-Mail-1--894282949 --Apple-Mail-1--894282949 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii 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. > =20 > 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.= --Apple-Mail-1--894282949--