Re: Nested query with GROUP BY ... HAVING COUNT(*) ... hangs 4.1.3 beta

2004-07-20 Thread Leo Siefert
Thanks for your response. >>> <[EMAIL PROTECTED]> 7/19/2004 11:47:39 AM >>> >It looks like your IN statement is forcing your inner SELECT to execute >once PER ROW of your main table. It is asking the engine to make sure that >_each and every_ id value in main meets the condition in the inner >

Re: Nested query with GROUP BY ... HAVING COUNT(*) ... hangs 4.1.3 beta

2004-07-19 Thread SGreen
It looks like your IN statement is forcing your inner SELECT to execute once PER ROW of your main table. It is asking the engine to make sure that _each and every_ id value in main meets the condition in the inner select. So, for each and every value in the table main, it has to re-computing t

Nested query with GROUP BY ... HAVING COUNT(*) ... hangs 4.1.3 beta

2004-07-19 Thread Leo Siefert
OS: Win2k Server MySQL: 4.1.1 alpha / 4.1.3 beta Table type: INNO DB In my production environment, running the query: select * from main where id in (select main_id from receipt group by main_id having COUNT(*) > 5) will hang the server - sometimes for over a day, thugh it seems it will event