Un beau jour, Victoria Reznichenko a écrit: > "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'? >
There are any index or key for this table. It's table for log so there are any ID. -- Arno -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]