AW: OR vs UNION

2009-10-13 Thread Majk.Skoric
> -Ursprüngliche Nachricht- > Von: joerg.bru...@sun.com [mailto:joerg.bru...@sun.com] > Gesendet: Dienstag, 13. Oktober 2009 15:26 > An: Skoric, Majk > Cc: mysql@lists.mysql.com > Betreff: Re: OR vs UNION > > Majk, all, > > > I'm no optimizer

Re: OR vs UNION

2009-10-13 Thread Joerg Bruehe
Majk, all, I'm no optimizer expert, but your result doesn't really surprise me. I'll reorder your post because that makes reasoning simpler: majk.sko...@eventim.de wrote: > Hi List, First, your table: > TABLEDEF. > | KTEMP | CREATE TABLE `KTEMP` ( > `tid` bigint(20) NOT NULL auto_increment,

OR vs UNION

2009-10-13 Thread Majk.Skoric
Hi List, i have a problem with an OR STATEMENT. Maybe someone can explain to me why the mysql optimizer doesn't work like expected. Please have a look at following "similar" queries. mysql> explain SELECT * FROM KTEMP WHERE (buchungs_kunde_id = 'dfb49c8c0b441e9f' and veranst_id = 16058 and status