Re: Querying large table

2007-03-30 Thread Maciej Dobrzanski
In news:[EMAIL PROTECTED], Shadow [EMAIL PROTECTED] 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 --

Re: Querying large table

2007-03-30 Thread Brent Baisley
ctg='ctg' GROUP BY ctg; - Original Message - From: Shadow [EMAIL PROTECTED] To: mysql@lists.mysql.com Sent: Thursday, March 29, 2007 6:59 PM Subject: Querying large table Hey, guys. I have 2 tables: categories and items. COUNT(*) categories = 63 833 COUNT(*) items = 742 993 I need

Querying large table

2007-03-29 Thread Shadow
Hey, guys. I have 2 tables: categories and items. COUNT(*) categories = 63 833 COUNT(*) items = 742 993 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. Can anybody propose some

RE: Querying large table

2007-03-29 Thread Michael Gargiullo
) -Original Message- From: Shadow [mailto:[EMAIL PROTECTED] Sent: Thursday, March 29, 2007 07:00 PM Eastern Standard Time To: mysql@lists.mysql.com Subject:Querying large table Hey, guys. I have 2 tables: categories and items. COUNT(*) categories = 63 833 COUNT(*) items = 742 993

RE: Querying large table

2007-03-29 Thread Brown, Charles
scan on items because there isn't an index define for ctg on the items TABLE. Again, just one man's thought. -Original Message- From: Michael Gargiullo [mailto:[EMAIL PROTECTED] Sent: Thursday, March 29, 2007 6:10 PM To: Shadow; mysql@lists.mysql.com Subject: RE: Querying large table