Insert into table matching records from two other tables taking an incredibly long time
<p>I want to insert into a table matching records from two large, over 1M rows each, tables. I have a query prepared, however when I run it the query takes an extremely long time doing it. I run it and I have waited upwards to 45 minutes with no apparent results other than the table having taken some space while no records are showing.</p>

<p>This is the query I'm using:</p>

<pre><code>INSERT INTO matching_books(isbn, qoh, qoo, price, discount, return) SELECT bn.* FROM books_new AS bn INNER JOIN books_old as bo on bn.isbn = bo.isbn where 1;
</code></pre>

<p>Can you please tell me if I have it right? I'm trying to run it also on HeidiSQL and the program suddenly froze.</p>

<p>What am I doing wrong?</p>

<p>Thanks! </p>