<div>Hi Steve,</div><div><br></div>I'm using this version:<div><br></div><div>"POSTGIS="2.0.1 r9979" GEOS="3.3.3-CAPI-1.7.4" PROJ="Rel. 4.8.0, 6 March 2012" LIBXML="2.8.0""</div>
<div><br></div><div>in Ubuntu 12.10.</div><div><br></div><div>Thanks for the answers.<br><br><div class="gmail_quote">2013/2/14 Stephen Woodbridge <span dir="ltr"><<a href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">In addition you need to tell us what version of software you are running.<br>
<br>
select postgis_full_version();<br>
<br>
In the newer versions many of the ST_* function automatically do and appropriate && under the covers so adding it in does not improve anything, but dos make you query backwards compatible with older versions.<br>

<br>
-Steve W<div class="HOEnZb"><div class="h5"><br>
<br>
On 2/14/2013 7:06 PM, Andy Colson wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Try running the same query three or four times in a row.  I'll bet you<br>
get a different time for each of them.<br>
<br>
Your numbers are way to close together to say that one is faster than<br>
the other.<br>
<br>
-Andy<br>
<br>
<br>
On 02/14/2013 05:36 PM, Marcello Benigno wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello everybody,<br>
<br>
I wonder why this is happening, all tables are with indexes and has<br>
already run a vacuum analyze to all of them:<br>
<br>
SELECT ms_ucs,<br>
SUM(ST_Area(Geography((ST_<u></u>Intersection(analises.pol_<u></u>geom,ms_2010_s1.geom)))))/<u></u>10000<br>
<br>
AS area_ha<br>
FROM analises, ms_2010_s1<br>
WHERE analises.pol_geom && ms_2010_s1.geom<br>
AND ST_Intersects(analises.pol_<u></u>geom,ms_2010_s1.geom)<br>
GROUP BY ms_ucs; *-- 889 ms*<br>
<br>
SELECT ms_ucs,<br>
SUM(ST_Area(Geography((ST_<u></u>Intersection(analises.pol_<u></u>geom,ms_2010_s1.geom)))))/<u></u>10000<br>
<br>
AS area_ha<br>
FROM analises, ms_2010_s1<br>
WHERE ST_Intersects(analises.pol_<u></u>geom,ms_2010_s1.geom)<br>
GROUP BY ms_ucs; *-- 870 ms !!!*<br>
<br>
Please note that the second, without using the && operator was faster,<br>
there's something wrong or I'm not understanding the functioning of<br>
the index?<br>
<br>
Thanks in advance,<br>
--<br>
*Marcello Benigno B. de Barros Filho*<br>
Prof. do Curso Superior de Tecnologia em Geoprocessamento - IFPB<br>
Mestre em Ciências Geodésicas e Tecnologias da Geoinformação - UFPE<br>
Doutorando em Tecnologia Ambiental e Recursos Hídricos - UFPE<br>
<a href="http://profmarcello.blogspot.com" target="_blank">http://profmarcello.blogspot.<u></u>com</a><br>
<a href="http://about.me/marcello.benigno" target="_blank">http://about.me/marcello.<u></u>benigno</a><br>
<br>
<br>
______________________________<u></u>_________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-<u></u>bin/mailman/listinfo/postgis-<u></u>users</a><br>
<br>
</blockquote>
<br>
______________________________<u></u>_________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-<u></u>bin/mailman/listinfo/postgis-<u></u>users</a><br>
</blockquote>
<br>
______________________________<u></u>_________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-<u></u>bin/mailman/listinfo/postgis-<u></u>users</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><b>Marcello Benigno B. de Barros Filho</b><br><font size="1">Prof. do Curso Superior de Tecnologia em Geoprocessamento - IFPB<br>Mestre em Ciências Geodésicas e Tecnologias da Geoinformação - UFPE</font><div>
<font size="1">Doutorando em Tecnologia Ambiental e Recursos Hídricos - UFPE</font><font size="1"><br></font><font size="1"><a href="http://profmarcello.blogspot.com" target="_blank">http://profmarcello.blogspot.com</a></font><div>
<a href="http://about.me/marcello.benigno" target="_blank"><font size="1">http://about.me/marcello.benigno</font></a></div></div>
</div>