OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Re: Querying large table

From: Maciej Dobrzanski (reg.mysqlposterus.com)
Date: Fri Mar 30 2007 - 03:33:56 CDT


In news:907873.28994.qmweb52811.mail.re2.yahoo.com,
Shadow <shadow_developeryahoo.com> wrote:

> I need to get number of items in a specific category, so I use
> SELECT COUNT(*) FROM items WHERE ctg='<ctg>'
>
> But each query takes ~ 10seconds.
> Its really slow.

You may add an index on `items`.`ctg` if there is none.

Maciek

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