<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Bad performance using st_geometry functions in oracle in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/bad-performance-using-st-geometry-functions-in/m-p/197891#M11334</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I simulated your dataset with 200 points and 1.5m polygons, and successfully queried:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;SELECT a.polyid, p.pointid
FROM f_pnts p, f_pols a
WHERE SDE.st_intersects(a.poly,p.point)=1;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;in&amp;nbsp; 847.96 ms. I gave up on&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;SELECT a.polyid, p.pointid
FROM f_pnts p, f_pols a
WHERE SDE.st_intersects(p.point,a.poly)=1;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;after ten minutes.&amp;nbsp; When I dropped the polygon count by an order of magnitude,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;this "find points which overlap polys" query ran in 14.56 minutes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So the moral of this story is to make sure you place the smaller set of geometries&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; in the second position in the Oracle SDE.ST_INTERSECTS operator.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Note:&amp;nbsp; The PostgreSQL optimizer works differently, so the equivalent query on &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;SDE.ST_GEOMETRY in PG 9.1 returned in &amp;lt;45ms against 216k polygons, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;no matter the order, and completed in &amp;lt;50ms against 1.34m polygons.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- V&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 09:53:04 GMT</pubDate>
    <dc:creator>VinceAngelo</dc:creator>
    <dc:date>2021-12-11T09:53:04Z</dc:date>
    <item>
      <title>Bad performance using st_geometry functions in oracle</title>
      <link>https://community.esri.com/t5/data-management-questions/bad-performance-using-st-geometry-functions-in/m-p/197889#M11332</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;We have a 10.2 geodatabase running in an Oracle 11.2.0.7 AIX server.&amp;nbsp; I'm testing running some simple st functions to see how it works, but the performance so far is really bad.&amp;nbsp; The query tested is...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;select t.designatio,p.catastro&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;from GIS.puntos_control t ,GIS.parcelas_evw p &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;where sde.st_intersects (t.shape,p.shape)=1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;and rownum&amp;lt;5;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;puntos_control is a point feature (198 features) and parcelas is a polygon feature (1,381,141 features).&amp;nbsp; I want the designation number of each point and the parcel number of each polygon it intersects with.&amp;nbsp; I added rownum&amp;lt;5 to have a quick response, but it took 3952.163 seconds to fetched just 4 rows.&amp;nbsp; In the database I can see a lot of non-database CPU time and the wait event "External procedure call".&amp;nbsp; Tried the same thing in a test PostGIS database with no geodatabase and it took a few seconds for all the points.&amp;nbsp; Any suggestions are welcome.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Mar 2014 19:26:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/bad-performance-using-st-geometry-functions-in/m-p/197889#M11332</guid>
      <dc:creator>Ulises</dc:creator>
      <dc:date>2014-03-14T19:26:45Z</dc:date>
    </item>
    <item>
      <title>Re: Bad performance using st_geometry functions in oracle</title>
      <link>https://community.esri.com/t5/data-management-questions/bad-performance-using-st-geometry-functions-in/m-p/197890#M11333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Try flipping the order of your parameters.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- V&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Mar 2014 20:43:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/bad-performance-using-st-geometry-functions-in/m-p/197890#M11333</guid>
      <dc:creator>VinceAngelo</dc:creator>
      <dc:date>2014-03-14T20:43:58Z</dc:date>
    </item>
    <item>
      <title>Re: Bad performance using st_geometry functions in oracle</title>
      <link>https://community.esri.com/t5/data-management-questions/bad-performance-using-st-geometry-functions-in/m-p/197891#M11334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I simulated your dataset with 200 points and 1.5m polygons, and successfully queried:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;SELECT a.polyid, p.pointid
FROM f_pnts p, f_pols a
WHERE SDE.st_intersects(a.poly,p.point)=1;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;in&amp;nbsp; 847.96 ms. I gave up on&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;SELECT a.polyid, p.pointid
FROM f_pnts p, f_pols a
WHERE SDE.st_intersects(p.point,a.poly)=1;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;after ten minutes.&amp;nbsp; When I dropped the polygon count by an order of magnitude,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;this "find points which overlap polys" query ran in 14.56 minutes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So the moral of this story is to make sure you place the smaller set of geometries&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; in the second position in the Oracle SDE.ST_INTERSECTS operator.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Note:&amp;nbsp; The PostgreSQL optimizer works differently, so the equivalent query on &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;SDE.ST_GEOMETRY in PG 9.1 returned in &amp;lt;45ms against 216k polygons, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;no matter the order, and completed in &amp;lt;50ms against 1.34m polygons.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- V&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:53:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/bad-performance-using-st-geometry-functions-in/m-p/197891#M11334</guid>
      <dc:creator>VinceAngelo</dc:creator>
      <dc:date>2021-12-11T09:53:04Z</dc:date>
    </item>
    <item>
      <title>Re: Bad performance using st_geometry functions in oracle</title>
      <link>https://community.esri.com/t5/data-management-questions/bad-performance-using-st-geometry-functions-in/m-p/197892#M11335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I gave up on&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;SELECT a.polyid, p.pointid
FROM f_pnts p, f_pols a
WHERE SDE.st_intersects(p.point,a.poly)=1;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;after ten minutes.&amp;nbsp; When I dropped the polygon count by an order of magnitude,&lt;BR /&gt;&lt;STRONG&gt;this "find points which overlap polys" query ran in &lt;SPAN style="text-decoration:underline;"&gt;14.56 minutes&lt;/SPAN&gt;.&lt;BR /&gt;&lt;/STRONG&gt;&lt;BR /&gt;...&lt;BR /&gt;Note:&amp;nbsp; &lt;STRONG&gt;The PostgreSQL optimizer works differently&lt;/STRONG&gt;, so the equivalent query on &lt;BR /&gt;SDE.ST_GEOMETRY in PG 9.1 returned in &lt;STRONG&gt;&amp;lt;45ms&lt;/STRONG&gt; against 216k polygons, &lt;BR /&gt;no matter the order, and completed in &lt;STRONG&gt;&amp;lt;50ms&lt;/STRONG&gt; against 1.34m polygons.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Looking at these figures, wouldn't it be better to say the Oracle optimizer &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;isn't working at all&lt;/SPAN&gt;&lt;SPAN&gt; for this particular case of the order of the datasets input to the the SDE.st_intersects command?, whereas the PostgreSQL optimizer, correctly considers optimal order for processing the command?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is this an Oracle issue, or does ESRI need to adjust the ST_GEOMETRY implementation for Oracle, to have the Oracle optimizer optimally process the command?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:53:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/bad-performance-using-st-geometry-functions-in/m-p/197892#M11335</guid>
      <dc:creator>MarcoBoeringa</dc:creator>
      <dc:date>2021-12-11T09:53:07Z</dc:date>
    </item>
    <item>
      <title>Re: Bad performance using st_geometry functions in oracle</title>
      <link>https://community.esri.com/t5/data-management-questions/bad-performance-using-st-geometry-functions-in/m-p/197893#M11336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I stand by the "differently" designation.&amp;nbsp; I don't know enough about Oracle &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;optimizer hints, but I imagine you could change the query text to make the&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;incorrect order function perform adequately.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Esri has no control over what is available in the developer libraries for database &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;extensions.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- V&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 16 Mar 2014 12:56:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/bad-performance-using-st-geometry-functions-in/m-p/197893#M11336</guid>
      <dc:creator>VinceAngelo</dc:creator>
      <dc:date>2014-03-16T12:56:30Z</dc:date>
    </item>
  </channel>
</rss>

