FOUND_ROWS & UNION

2006-07-04 Thread Taras D
Hi everyone, I have a couple of questions invovling using FOUND_ROWS() and UNION. The manual states that: "The value of FOUND_ROWS() is exact only if UNION ALL is used. If UNION without ALL is used, duplicate removal occurs and the value of FOUND_ROWS() is only approximate." I am using UNION DI

Re: OR isn't optimised

2006-06-10 Thread Taras D
CTED]> wrote: Hi again Taras - Clearly, I was off the mark - sorry! What if you remove the straight_join specification and let MySQL's JOIN optimizer do its own thing? Dan Taras D wrote: > Sorry everyone, forgot to put in my setup detail! > > SQL version: 5.0.22-community-nt &g

Re: OR isn't optimised

2006-06-08 Thread Taras D
ut you're running 5.0!) I wonder if you'd have better success with the version you're on if you re-wrote your query more like so: select straight_join * from l,d where (l.sId = d.dId) and (d.sId in (1, 2)); Dan Taras D wrote: > Hi everyone, > > I have the following schem

Why is the REF column NULL, and why is the key_len 5?

2006-06-08 Thread Taras D
Hi everyone, Should be an easy question, but I couldn't find the answer anywhere. Firstly, I can't figure out why the REF column shows NULL, and secondly I don't know why the key length is 5. I have the following db: table l ( aId int unsigned not null auto_increment primary key, sId smallint

OR isn't optimised

2006-06-07 Thread Taras D
Hi everyone, I have the following schema: create table l ( aId int unsigned not null auto_increment primary key, sId smallint unsigned not null, dId smallint unsigned, index(sId,dId) ); create table d ( sId smallint unsigned not null, dId smallint unsigned not null, primary key(sId, dId)