<br><br><div class="gmail_quote">On 19 October 2011 18:21, Gheorghiu, Mihai <span dir="ltr"><<a href="mailto:mgheorghiu@chpmail.com">mgheorghiu@chpmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div lang="EN-US" link="blue" vlink="purple"><div><p class="MsoNormal">I have a query that places points in polygons:</p><p class="MsoNormal">insert into results (</p><p class="MsoNormal">                select a.point_id, b.polygon_id  </p>
<p class="MsoNormal">                from  points a, polygons b </p><p class="MsoNormal">                where st_contains(ST_GeomFromWKB(ST_AsBinary(b.geog),4326),ST_GeomFromWKB(ST_AsBinary(a.geog),4326)) = 't' </p>
<p class="MsoNormal">); </p><p class="MsoNormal">There are ~1M points and ~300k polygons. There are geo indexes on the geog columns of both tables.</p><p class="MsoNormal">What changes would make the query faster?</p><p class="MsoNormal">
 </p><p class="MsoNormal">Thank you very much.</p><p class="MsoNormal"> </p><p class="MsoNormal">Michael</p></div></div>

</blockquote></div><div><br></div><div><br></div><div>... and the problem is?<br></div><div><br></div><div>Especially I'd like to know is the time, show us explain analyze of the query and show table structures.</div>
<div><br></div><div>regards</div><div>Szymon</div><div><br></div><div><br></div>-- <br><a href="http://simononsoftware.com/" target="_blank"><b><font face="arial, helvetica, sans-serif" style="background-color:rgb(255, 255, 255)" color="#003300">http://simononsoftware.com/</font></b></a><br>
<br>