Comparing records in one table to another for large databases in PHP : <p>I have two tables in MySQL database. Lets say there are 1800 records in table 1 and 20000 records in table 2. Now I want to compare each record in table 1 to table 2 and update some fields in table 2 for the records that are matched. </p>

<p>I want to know what is the most optimized way to do this.</p>
