Efficient way to move large number of rows from one table to another new table using postgres
<p>I am using <strong>PostgreSQL</strong> database for live project. In which, I have one table with 8 columns.
This table contains millions of rows, so to make search faster from table, I want to delete and store old entries from this table to new another table.</p>

<p>To do so, I know one approach:</p>

<ul>
<li>first select some rows </li>
<li>create new table </li>
<li>store this rows in that table</li>
<li>than delete from main table.</li>
</ul>

<p>But it takes too much time and it is not efficient. </p>

<p>So I want to know what is the best possible approach to perform this in postgresql database?</p>

<p>Postgresql version: <code>9.4.2.</code><br>
Approx number of rows: 8000000<br>
I want to move rows: 2000000</p>