<html><head></head><body>I would need double check if overlaps uses an index. <br>
<br>
If it does you can use explain to figure out which table is being fill y scanned and adjust the order in the statement accordingly. <br>
<br>
If it doesn't, then you can use something that does (e.g. &&) and ensure that the smaller table is the one being scanned.<br>
<br>
Jim<br><br><div class="gmail_quote">On July 15, 2016 9:15:55 AM EDT, Richard McDonnell <richard.mcdonnell@opw.ie> wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">Need a little help, this may not be the forum, but I thought I would <br />throw it out there!<br />I am looking to minimise the search area in this query<br /><br />SELECT objectid<br />FROM<br />level_1_20151206 AS A, water_polygon AS Z<br />WHERE<br />(SELECT ST_Overlaps (A.the_geom, Z.geom));<br /><br />What I want to do is use the extent of A's geometry to limit the search <br />for overlaps with Z if that makes sense!?<br />These are both large National coverage datasets.<br />Any help suggestions welcomed!!<br /><br />Regards,<br /><br />Richard.<br /><br /><br /><br />OPW - Ag féachaint don am atá le teacht - Ag caomhnú ón am atá thart<br />OPW - Looking to the future - Caring for the past<br /><br />***********************************************************<br />Email Disclaimer: <a href="http://www.opw.ie/en/disclaimer">http://www.opw.ie/en/disclaimer</a>/<br /><br /><hr /><br />Qgis-user mailing list<br />Qgis-user@lists.osgeo.org<br />List info:
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-user">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br />Unsubscribe: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user">http://lists.osgeo.org/mailman/listinfo/qgis-user</a></pre></blockquote></div><br>
-- <br>
Sent from my Android device with K-9 Mail. Please excuse my brevity.</body></html>