Extremly slow Join with 'OR'

2010-08-17 Thread Влад Р
The main problem - if add in Join on `OR`-condition, select become VERY slow. I realy have to use this condition. -- -- -- `tree_data` -- CREATE TABLE IF NOT EXISTS `tree_data` ( `id` int(11) NOT NULL AUTO_INCREMENT, `pid` int(11) NOT

Re: Extremly slow Join with 'OR'

2010-08-17 Thread Johan De Meersman
You may want to split of your or conditions into a separate query, and use UNION. On Tue, Aug 17, 2010 at 11:22 AM, Влад Р vul...@gmail.com wrote: The main problem - if add in Join on `OR`-condition, select become VERY slow. I realy have to use this condition. --

Re: Extremly slow Join with 'OR'

2010-08-17 Thread Ananda Kumar
use UNION ALL ..instead of UNION for better performance... On Tue, Aug 17, 2010 at 5:01 PM, Johan De Meersman vegiv...@tuxera.bewrote: You may want to split of your or conditions into a separate query, and use UNION. On Tue, Aug 17, 2010 at 11:22 AM, Влад Р vul...@gmail.com wrote: The

Re: Extremly slow Join with 'OR'

2010-08-17 Thread Johan De Meersman
Only if you want to see duplicate rows :-) On Tue, Aug 17, 2010 at 2:21 PM, Ananda Kumar anan...@gmail.com wrote: use UNION ALL ..instead of UNION for better performance... On Tue, Aug 17, 2010 at 5:01 PM, Johan De Meersman vegiv...@tuxera.be wrote: You may want to split of your or