I have 2 SQL tables that have a matching column - ID. ID is the primary key in both tables.
Table1: ID, field1, field2, ... field n Table 2: ID, fieldx, fieldy..... filed z
Both tables have around 400k-600k rows. I want to get the list of ID's from Table2 that matches with Table1 in the most optimized way. Brute force way of matching row-by-row would be very slow.
Please suggest an optimal/lesser time-complexity solution.