<?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 SQL query optimization tips in ArcGIS Enterprise Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-questions/sql-query-optimization-tips/m-p/1176718#M33192</link>
    <description>&lt;P&gt;Does anyone have any SQL optimization tips they can share? Either for spatial queries or non-spatial queries?&lt;/P&gt;&lt;P&gt;&lt;EM&gt;I work with SDE.ST_GEOMETRY and SDO_GEOMETRY in Oracle 18c. But info about optimization in other DBs/datatypes is fine too.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;For example, I learned recently that the &lt;U&gt;cost&lt;/U&gt; of ST_GEOMETRY functions doesn’t get included in the explain plan cost. I had a query that used a bunch of nested ST_GEOMETRY functions (in the SELECT clause) that was &lt;U&gt;really slow&lt;/U&gt;, yet the explain plan cost was surprisingly low. It took me a while to realize that Oracle doesn’t usually include the cost of user-defined functions in the explain plan. Especially not for SDE.ST_GEOMETRY functions, since they’re stored in the EXTPROC.DLL file, not in the Oracle kernel. So Oracle has no way to know how expensive they are.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://stackoverflow.com/questions/66671812/are-functions-considered-in-execution-plan" target="_blank" rel="noopener"&gt;https://stackoverflow.com/questions/66671812/are-functions-considered-in-execution-plan&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any others come to mind?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Cheers.&lt;/P&gt;</description>
    <pubDate>Wed, 25 May 2022 15:51:54 GMT</pubDate>
    <dc:creator>Bud</dc:creator>
    <dc:date>2022-05-25T15:51:54Z</dc:date>
    <item>
      <title>SQL query optimization tips</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/sql-query-optimization-tips/m-p/1176718#M33192</link>
      <description>&lt;P&gt;Does anyone have any SQL optimization tips they can share? Either for spatial queries or non-spatial queries?&lt;/P&gt;&lt;P&gt;&lt;EM&gt;I work with SDE.ST_GEOMETRY and SDO_GEOMETRY in Oracle 18c. But info about optimization in other DBs/datatypes is fine too.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;For example, I learned recently that the &lt;U&gt;cost&lt;/U&gt; of ST_GEOMETRY functions doesn’t get included in the explain plan cost. I had a query that used a bunch of nested ST_GEOMETRY functions (in the SELECT clause) that was &lt;U&gt;really slow&lt;/U&gt;, yet the explain plan cost was surprisingly low. It took me a while to realize that Oracle doesn’t usually include the cost of user-defined functions in the explain plan. Especially not for SDE.ST_GEOMETRY functions, since they’re stored in the EXTPROC.DLL file, not in the Oracle kernel. So Oracle has no way to know how expensive they are.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://stackoverflow.com/questions/66671812/are-functions-considered-in-execution-plan" target="_blank" rel="noopener"&gt;https://stackoverflow.com/questions/66671812/are-functions-considered-in-execution-plan&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any others come to mind?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Cheers.&lt;/P&gt;</description>
      <pubDate>Wed, 25 May 2022 15:51:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/sql-query-optimization-tips/m-p/1176718#M33192</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2022-05-25T15:51:54Z</dc:date>
    </item>
  </channel>
</rss>

