"Arno" <[EMAIL PROTECTED]> wrote: > > I have aproximately 1,000,000 rows and I would like to do some query. The > first one is to get the number of row so I do : > > mysql> SELECT COUNT(*) FROM `Log`; > +----------+ > | COUNT(*) | > +----------+ > | 969129 | > +----------+ > 1 row in set (0.00 sec) > > mysql> SELECT COUNT(*) AS `Nb` FROM `Log` WHERE `ID` = 49; > +--------+ > | Nb | > +--------+ > | 969129 | > +--------+ > 1 row in set (1 min 20.99 sec) > > But like you can see it, it take a long with the WHERE clause. I use Pentium > III at 650 Mhz with 48 Mb of ram. I think that the probleme come from the > computer but I'm not shure (I need more RAM ?).
SELECT COUNT(*) without WHERE clause for only one MyISAM/ISAM table works very quickly. Because number of rows for this table is stored. As to the second query, do you have an index on column 'ID'? -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Victoria Reznichenko / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net <___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]