Query optimization help

2008-08-11 Thread Jonathan Terhorst
I have this query: SELECT DISTINCT t1.string FROM t1 LEFT JOIN t2 ON t1.string=t2.string LEFT JOIN t3 ON t1.int_a=t3.int_a LEFT JOIN t4 ON t1.int_b=t4.int_b WHERE t1.string != '' AND t2.string IS NULL AND t3.int_a = ORDER BY t1.string ASC

Re: Maybe easy, maybe hard SELECT puzzle :)

2003-11-12 Thread Jonathan Terhorst
That returns rows that have any of 'A01', 'B02'. I need the rows that have all of them. E.g. logical OR vs. logical AND. - Original Message - From: "Shane Allen" <[EMAIL PROTECTED]> To: "Jonathan Terhorst" <[EMAIL PROTECTED]>; <[EM

Strategies for optimizing a read-only table

2003-11-07 Thread Jonathan Terhorst
I could have sworn I posted this once before, but apparently it got lost somewhere. Apologies if you're seeing this twice: I'm wondering what I can do with MySQL to optimize reads (SELECTs) on a read-only table where data will never be INSERTed or UPDATEd. Okay, that's not entirely correct--the

Maybe easy, maybe hard SELECT puzzle :)

2003-11-07 Thread Jonathan Terhorst
I can't figure out if this is actually challenging or if it's a stupid question. Table1 is a normal old relation that describes a bunch of objects: Table1 (id INT PRIMARY KEY NOT NULL, Name varchar(255), Size int) etc. Associated with each Table1 record is a variable-length of 3-byte alphanumeric