Re: Group by optimization

2009-08-16 Thread Suhail Doshi
Peter, I am fairly certain, it's not slow because of the event_id look up but because of the GROUP BY Suhail On Sun, Aug 16, 2009 at 2:56 PM, Peter Brawley wrote: > Suhail, > > Having problems with this query, any ideas on how to optimize this further? > > Did you try writing the event_ids in

Re: Group by optimization

2009-08-16 Thread Peter Brawley
Suhail, Having problems with this query, any ideas on how to optimize this further? Did you try writing the event_ids in your IN() list to a temp table & joining to that table? PB - Suhail Doshi wrote: Having problems with this query, any ideas on how to optimize this further? mysql> e

Group by optimization

2009-08-16 Thread Suhail Doshi
Having problems with this query, any ideas on how to optimize this further? mysql> explain SELECT cache_property_str.name as name, SUM(cache_property_str.tally) as count FROM cache_property_str WHERE cache_property_str.status = 1 AND

Re: GROUP BY optimization headscratcher

2004-08-16 Thread Brent Baisley
---+ +--+-+ Thanks so much! -Matt -Original Message----- From: ÃÃ ÃÂÃ [mailto:[EMAIL PROTECTED] Sent: Saturday, August 14, 2004 3:46 AM To: Matt Eaton Subject: Re: GROUP BY optimization headscratcher ÐÐÑÐÐÑÑÐÑÐÑÐ Matt ME> CREATE TABLE `T1`

RE: GROUP BY optimization headscratcher

2004-08-14 Thread Matt Eaton
Message- From: ÃÃ ÃÃÃÃÃÂÃ [mailto:[EMAIL PROTECTED] Sent: Saturday, August 14, 2004 3:46 AM To: Matt Eaton Subject: Re: GROUP BY optimization headscratcher ÐÐÑÐÐÑÑÐÑÐÑÐ Matt ME> CREATE TABLE `T1` ( ME> `guid` smallint(5) unsigned NOT NULL default '0', ME> `qid` small

Re: GROUP BY optimization headscratcher

2004-08-14 Thread Михаил Монашёв
Здравствуйте Matt ME> CREATE TABLE `T1` ( ME> `guid` smallint(5) unsigned NOT NULL default '0', ME> `qid` smallint(5) unsigned NOT NULL default '0', ME> `a` tinyint(2) NOT NULL default '-2', ME> `d` tinyint(2) NOT NULL default '-2', ME> KEY `IX_FW_qid` (`qid`), ME> KEY `IX_FW_d` (`d`)

GROUP BY optimization headscratcher

2004-08-13 Thread Matt Eaton
Hi all. Got a weird one. Mysql 4.0.20. Let's say for the sake of argument that I've got two tables, T1 & T2. Here are the two create statements: CREATE TABLE `T1` ( `guid` smallint(5) unsigned NOT NULL default '0', `qid` smallint(5) unsigned NOT NULL default '0', `a` tinyint(2) NOT NULL