I am trying to run a query from a mySQL database on a PHP page. The tables contain about 40,000 records each. When I run an INNER join on the tables, i can return all values in under a second. When I use the same query with a LEFT join, php times out and often crashes my computer. What is going on? What bothers me even more, is that both queries work and are faster when using Microsoft Access. I am using mySQL 3.23.49 and PHP 4.1.1 on windows 2000 with IIS5
Here are my queries:
"SELECT Table1.ID, Table2.ID
FROM Table1 INNER JOIN Table2 ON (Table1.ID = Table2.ID) WHERE Table1.ID = Value" (runs in under 1 second)
"SELECT Table1.ID, Table2.ID
FROM Table1 LEFT JOIN Table2 ON (Table1.ID = Table2.ID) WHERE Table1.ID = Value" (times out and never completes when run in PHP)
Thanks for any help you can provide.