<div>Hi,</div>
<div>&nbsp;</div>
<div>I am fairly new to Postgis so I like some feedback whether I am going through the right moves.</div>
<div>I am trying to create a new table with the intersected results from two input polygon tables.</div>
<div>Both&nbsp;tables are in NZMG (2193) the first table has 100000+ records, the second table has 400000+ records.</div>
<div>The query I am using is:</div>
<div>&nbsp;</div>Create table ablc_pol with OIDS as<br>SELECT intersection(a.geom, l.geom) as intersect_geom, a.*, l.&quot;CLASS&quot;,l.&quot;NAME&quot;, l.&quot;REPLID&quot;<br>from first_table a,&nbsp;second_table l<br>Where a.geom
 &amp;&amp; l.geom<br>AND intersects(a.geom, l.geom);
<div>&nbsp;</div>
<div>Currently this query is taking &gt;200 hours before I cancelled it because I wasn&#39;t sure it would ever end. However, running it on a small subset showed satisfactory results...</div>
<div>I am using version 1.2 on Windows.</div>
<div>Does it matter which table I put first in the query or would the optimizer take care of that?</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>Cheers,</div>
<div>Niels</div>
<div>&nbsp;</div>