Good day everyone,

I've been having trouble using OR in my queries. I hope someone could
help me.

I have three tables t0 (k0, k1, k2), t1 (k0, k1), and t2 (k0, k2),
linked through three columns k0, k1, k2. Specifically the linkages are:

        t0.k0 = t1.k0 and t0.k0 = t2.k0 and ( (t0.k1 = t1.k1 and t0.k2 =
t2.k2) OR (t0.k1 = t2.k1 and t0.k2 = t1.k2) )

this results in an extremely slow query. When I tried the following
queries individually, they turned out to be very fast:

        t0.k0 = t1.k0 and t0.k0 = t2.k0 and (t0.k1 = t1.k1 and t0.k2 =
t2.k2) 

        t0.k0 = t1.k0 and t0.k0 = t2.k0 and (t0.k1 = t2.k1 and t0.k2 =
t1.k2) 

I tried using different indexes on these tables, but none seemed to
work. I am using mysqld 4.0.15a. If you happen to know the reason,
please give me a hand. 

Thank you for your time.

Eric





-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to