<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1506" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi to all PostGIS-users....</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I have a table "earthquakes" with a GiSt-index on
column "geo". I search for all earthquakes along a street using a buffer
distance.</FONT></DIV>
<DIV><FONT face=Arial size=2>Does somebody know, why the GiST-index is not
in use (as per explain), when combining the &&-operator with the
transform()-function like in:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV><FONT face=Arial size=2>
<DIV><STRONG>select </STRONG>quake_id, location, x(geo), y(geo) </DIV>
<DIV><STRONG>from</STRONG> earthquakes </DIV>
<DIV><STRONG>where</STRONG> geo && envelope(buffer(transform((select geo
from roads where name = 'U.S. Hwy 85'),102009),5)) and within(geo,(select
buffer(transform((select geo from roads where name = 'U.S. Hwy
85'),102009),5)));</DIV>
<DIV> </DIV>
<DIV>Without the transform-function the query is very quick because of the
GiST-index, but i need the transform-function to calculate in unit
"meter".</DIV>
<DIV> </DIV>
<DIV>Can somebody help me, thanks a lot!</DIV>
<DIV> </DIV>
<DIV>Christian.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV></BODY></HTML>