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

Re: OR isn't optimised

2006-06-10 Thread Taras D
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 Windows 2000 Professional 5.0, SP 4 Dan, I tried your suggestion

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

Re: OR isn't optimised

2006-06-08 Thread Taras D
!) 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 schema: create table l ( aId int unsigned not null

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,