Have you tried explain? Do all of your ID fields have indexes? Have you tried breaking it into multiple statements? Each statement creating a temp table except the last?
=C= * * Cal Evans * The Virtual CIO * http://www.calevans.com * -----Original Message----- From: Lorenzo De Vito [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 17, 2002 4:44 AM To: [EMAIL PROTECTED] Subject: Query too slow I've this query that is too slow, how can I optimize this sintax ? SELECT * FROM table_1 INNER JOIN table_2 ON ID_table_2=table_1_ID INNER JOIN table_3 ON ID_table_3=table_2_ID INNER JOIN table_4 ON ID_table_4=table_3_ID INNER JOIN table_5 ON ID_table_5 = table_4_ID INNER JOIN table_6 ON ID_table_6 = table_5_ID WHERE ID_table_2 > 1000 AND ID_table_5 > 700; --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php