<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Chetan Tiwari wrote:
<blockquote
 cite="mid:cee91c340706161706x61aea715j910505f8ebe4a0cf@mail.gmail.com"
 type="cite">Hi All<br>
  <br>
I had a quick question about a relatively simple problem. I have 2
point-based datasets (table1 and table2). I'd like to find out which
dataset covers a larger geographic area. I guess there can be several
ways of trying to figure that out. What I'm using is a query like
  <br>
  <br>
select extent(t1.the_geom) ~ extent(t2.the_geom) from myschema.table1
t1, myschema.table2 t2;<br>
</blockquote>
Might ST_convexhull() give a "better" result.? You could then use the
ST_area() function on it...  I think ST_extent() will give you a box3d,
which might be much larger than the geographical area covered.<br>
<blockquote
 cite="mid:cee91c340706161706x61aea715j910505f8ebe4a0cf@mail.gmail.com"
 type="cite"><br>
Table 1 contains about 5500 points and table 2 around 8000. The query
takes about a minute to execute (with and without indexes on the_geom)
and I was wondering if there was something that I was doing wrong or if
there was a more efficient way of accomplishing this task? <br>
</blockquote>
I don't think an index could be used here, since you're using a
function that requires each individual value and therefore a table
scan. <br>
<blockquote
 cite="mid:cee91c340706161706x61aea715j910505f8ebe4a0cf@mail.gmail.com"
 type="cite"><br>
Thanks much,<br>
  <br>
Chetan<br clear="all">
  <br>
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
postgis-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a>
<a class="moz-txt-link-freetext" href="http://postgis.refractions.net/mailman/listinfo/postgis-users">http://postgis.refractions.net/mailman/listinfo/postgis-users</a>
  </pre>
</blockquote>
Chander<br>
</body>
</html>