Re: Query very slow - Using temporary; Using filesort

2004-09-09 Thread JVanV8
After Shawn's guidance, I tried inserting with the temporary table method using this: CREATE TEMPORARY TABLE tmpStats (KEY(product_id)) SELECT TP.thread_id, COUNT(TP.thread_id) AS num_posts, MAX(TP.post_date) AS last_update FROM thread_post AS TP INNER JOIN thread_link AS TL ON TP.thread_i

Re: Query very slow - Using temporary; Using filesort

2004-09-09 Thread JVanV8
Thanks Shawn, I'm going to give the temporary table idea a try. I did omit the 'category' table while testing but when I used EXPLAIN the # of rows for the thread_link join increased from 105 to 16326 so I decided to leave the category table in. But I agree, it isn't needed. My other idea I ha

Re: Query very slow - Using temporary; Using filesort

2004-09-09 Thread SGreen
I know you said this was a translation of your original query. Assuming that it is a faithful translation, I have the following suggestions: Do not enclose numbers with quotes (category_id is a number, right? No quotes are needed) You do not need include the table "category" in this query. You