Re: [PERFORM] Help with rewriting query

2005-06-08 Thread Jim Johannsen
How about SELECT p_id, f_id FROM person as p LEFT JOIN (SELECT f.p_id, max(f.id), f_item FROM food) as f ON p.p_id = f.p_id Create an index on Food (p_id, seq #) This may not gain any performance, but worth a try. I don't have any data similar

Re: [PERFORM] Help trying to tune query that executes 40x slower

2005-03-09 Thread Jim Johannsen
Hugo, I think your problem is with the MRS_TRANSACTION TRANS table. It is not joining anything when declared, but later it is joining thru a LEFT JOIN of the REPL_DATA_OWNER_RSDNC table. In fact I'm not sure that this table is really needed. I would suggest rewriting your FROM clause. It