<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Cambria;
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
code
        {mso-style-priority:99;
        font-family:"Courier New";}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Create the gist index on table containing points using the following syntax:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">CREATE INDEX <index name> ON <table name> USING GIST (<geometry column name>);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">After the index is created use the criteria st_contains(polygon,point)  in the where clause of select statement:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Select * from <tablename> where st_contains(polygon, point) ;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Cambria","serif";color:black">Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:14.0pt;font-family:"Cambria","serif";color:black"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Cambria","serif";color:black">Kedar Tambade </span><span style="font-family:"Calibri","sans-serif";color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:black"> <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:black">This electronic mail message and any attached files contain information intended for the exclusive use of the individual or entity to whom it is addressed and
 may contain information that is propriety, privileged, confidential and/or exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any viewing, copying, disclosure or distribution of this information
 may be subject to legal restriction or sanction. Please notify the sender, by electronic mail or telephone, of any unintended recipients and delete the original message without making any copies.</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> postgis-users-bounces@lists.osgeo.org [mailto:postgis-users-bounces@lists.osgeo.org]
<b>On Behalf Of </b>BladeOfLight16<br>
<b>Sent:</b> Wednesday, June 05, 2013 2:29 PM<br>
<b>To:</b> PostGIS Users Discussion; pgsql-general@postgresql.org<br>
<b>Subject:</b> [postgis-users] point_ops with GiST PostGIS Spatial Index<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I posted this question on StackOverflow, and the only person to answer recommended I ask these lists for more details and link to the question:<br>
<a href="http://stackoverflow.com/questions/16927331/postgresql-point-ops-with-gist-postgis-spatial-index" target="_blank">http://stackoverflow.com/questions/16927331/postgresql-point-ops-with-gist-postgis-spatial-index</a><br>
<br>
My question is:<br>
<br>
The <a href="http://www.postgresql.org/docs/9.2/static/release-9-0.html" target="_blank">
9.0 release notes</a> for PostgreSQL states the following change: <o:p></o:p></p>
<p>Add point_ops operator class for GiST (Teodor Sigaev)<o:p></o:p></p>
<p>This feature permits GiST indexing of point columns. The index can be used for several types of queries such as
<code><span style="font-size:10.0pt">point <@ polygon</span></code> (point is in polygon). This should make many PostGIS queries faster.<o:p></o:p></p>
<p>I have a very large table (millions of rows) with a <code><span style="font-size:10.0pt">GEOMETRY(POINT,[SRID])</span></code> column that I sometimes compare to polygons. Do I need to do anything to enable this when creating the index? Do I have to use the
 operator indicated, or would this work with <a href="http://postgis.refractions.net/docs/ST_Contains.html" target="_blank">
<code><span style="font-size:10.0pt">ST_Contains</span></code></a> which uses <code>
<span style="font-size:10.0pt">&&</span></code> internally?<o:p></o:p></p>
<p class="MsoNormal">Thanks for any help.<o:p></o:p></p>
</div>
</body>
</html>