<?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 arcpy.env.workspace assignment takes excessively long (3 minutes) in ArcGIS Enterprise Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-questions/arcpy-env-workspace-assignment-takes-excessively/m-p/491514#M19043</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wrote a script to determine how long it takes to set arcpy.env.workspace to a series of feature datasets within an enterprise geodatabase(SDE 10.2.2 on SQL Server 2012), and these are my results.&amp;nbsp; You can see that some of the assignments take longer than 3 minutes, and it's just assigning a workspace!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;7.3149998188seconds to set EONGIS.SDE.faa as workspace&lt;/P&gt;&lt;P&gt;1.0720000267seconds to set EONGIS.SDE.mlquery as workspace&lt;/P&gt;&lt;P&gt;222.508000135seconds to set EONGIS.SDE.naturalhazards as workspace&lt;/P&gt;&lt;P&gt;79.6970000267seconds to set EONGIS.SDE.partnerfeeds as workspace&lt;/P&gt;&lt;P&gt;0.561000108719seconds to set EONGIS.SDE.space as workspace&lt;/P&gt;&lt;P&gt;2.94499993324seconds to set EONGIS.SDE.Boundaries as workspace&lt;/P&gt;&lt;P&gt;221.398999929seconds to set EONGIS.SDE.naturalhazards2 as workspace&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For reference, here is the script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy, time
uri = r"C:\EsriEON\eon\publishing\connections\eon_connection.sde"
arcpy.env.workspace = uri
dsets = arcpy.ListDatasets()
for dset in dsets:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; start = time.time()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.env.workspace = uri + "\\" + dset
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end = time.time()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print str(end-start) + "seconds to set " + dset + " as workspace"
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So obviously the naturalhazards feature dataset is the most problematic.&amp;nbsp; But so is partnerfeeds.&amp;nbsp; Naturalhazards2 is an exact copy of the original naturalhazards.&amp;nbsp; I created naturalhazards2 to see if there was some corruption in naturalhazards.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's some contextual information...&lt;/P&gt;&lt;P&gt;My geodatabase is mostly feature datasets with feature classes inside, but also has some locators, and a toolbox.&amp;nbsp; There is nothing unique about any of the feature datasets except the data within them.&amp;nbsp; Each contains between 2 and 6 feature classes and that's it, and each is used as the source for some server map services.&amp;nbsp; Does anyone have any suggestions on why these times may vary so much?&amp;nbsp; How to troubleshoot why some may be taking longer than others? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 21:37:59 GMT</pubDate>
    <dc:creator>Jay_Gregory</dc:creator>
    <dc:date>2021-12-11T21:37:59Z</dc:date>
    <item>
      <title>arcpy.env.workspace assignment takes excessively long (3 minutes)</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/arcpy-env-workspace-assignment-takes-excessively/m-p/491514#M19043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wrote a script to determine how long it takes to set arcpy.env.workspace to a series of feature datasets within an enterprise geodatabase(SDE 10.2.2 on SQL Server 2012), and these are my results.&amp;nbsp; You can see that some of the assignments take longer than 3 minutes, and it's just assigning a workspace!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;7.3149998188seconds to set EONGIS.SDE.faa as workspace&lt;/P&gt;&lt;P&gt;1.0720000267seconds to set EONGIS.SDE.mlquery as workspace&lt;/P&gt;&lt;P&gt;222.508000135seconds to set EONGIS.SDE.naturalhazards as workspace&lt;/P&gt;&lt;P&gt;79.6970000267seconds to set EONGIS.SDE.partnerfeeds as workspace&lt;/P&gt;&lt;P&gt;0.561000108719seconds to set EONGIS.SDE.space as workspace&lt;/P&gt;&lt;P&gt;2.94499993324seconds to set EONGIS.SDE.Boundaries as workspace&lt;/P&gt;&lt;P&gt;221.398999929seconds to set EONGIS.SDE.naturalhazards2 as workspace&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For reference, here is the script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy, time
uri = r"C:\EsriEON\eon\publishing\connections\eon_connection.sde"
arcpy.env.workspace = uri
dsets = arcpy.ListDatasets()
for dset in dsets:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; start = time.time()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.env.workspace = uri + "\\" + dset
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end = time.time()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print str(end-start) + "seconds to set " + dset + " as workspace"
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So obviously the naturalhazards feature dataset is the most problematic.&amp;nbsp; But so is partnerfeeds.&amp;nbsp; Naturalhazards2 is an exact copy of the original naturalhazards.&amp;nbsp; I created naturalhazards2 to see if there was some corruption in naturalhazards.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's some contextual information...&lt;/P&gt;&lt;P&gt;My geodatabase is mostly feature datasets with feature classes inside, but also has some locators, and a toolbox.&amp;nbsp; There is nothing unique about any of the feature datasets except the data within them.&amp;nbsp; Each contains between 2 and 6 feature classes and that's it, and each is used as the source for some server map services.&amp;nbsp; Does anyone have any suggestions on why these times may vary so much?&amp;nbsp; How to troubleshoot why some may be taking longer than others? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:37:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/arcpy-env-workspace-assignment-takes-excessively/m-p/491514#M19043</guid>
      <dc:creator>Jay_Gregory</dc:creator>
      <dc:date>2021-12-11T21:37:59Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.env.workspace assignment takes excessively long (3 minutes)</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/arcpy-env-workspace-assignment-takes-excessively/m-p/491515#M19044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for running tests and putting some numbers to it. Would also love to know why this&amp;nbsp;is a thing!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Sep 2019 15:49:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/arcpy-env-workspace-assignment-takes-excessively/m-p/491515#M19044</guid>
      <dc:creator>AlexanderSt__John1</dc:creator>
      <dc:date>2019-09-19T15:49:11Z</dc:date>
    </item>
  </channel>
</rss>

