解答:因为用户删除的是数据库内的图层,但是我们配置的MXD里面仍然保存了删除前图层的信息,那么加载图层会首先遍历MXD里面保存的信息,对找不到的图层可能会进行多次的查询等,所以会很慢。那么我们可以使用打开MXD后,将TOC里面的无效信息清空,然后save as copy一个新的MXD即可。
如果是连接其他服务器,加载的时候长时间未响应,可以直接将网线拔掉!这样会加快打开MXD的效率。
--------------------------------------------------------------------------------
下载地址:http://arcscripts.esri.com/details.asp?dbid=16931
该工具是一个命令行工具,执行完毕之后,可以得到分析结果,可以看到每个图层的刷新时间,及图层显示时各阶段的时间,如果有问题,会在Recommendations里面给出建议,如下所示:
C:\Users\Administrator\Downloads\AS16931\mxdpefstat>mxdperfstat10prerelease -mxd c:\1.mxd -scale 250000 -width 1920 -heght 1028 2012-3-14 9:54:40 Checking License License: esriLicenseProductCodeArcInfo 2012-3-14 9:54:44 TestParams.SetParams check argsValid 2012-3-14 9:54:44 TestParams.SetParams ValidateMxd Start 2012-3-14 9:54:44 TestParams.SetParams ValidateMxd Finish 2012-3-14 9:54:44 new MainForm() 2012-3-14 9:54:44 InitializeComponent() 2012-3-14 9:54:45 InitializeComponent() Completed 2012-3-14 9:54:45 testParams.MxdDocumentPath 2012-3-14 9:54:45 mainForm.TestParams = testParams; 2012-3-14 9:54:45 Application.Run(mainForm) 2012-3-14 9:54:50(IMapControl3)axMapControl1.Object 2012-3-14 9:54:50axMapControl1.LoadMxFile(m_mapDocumentName) 2012-3-14 9:55:02 MainForm: RunTest(ref m_activeView) Starting test 2012-3-14 9:55:03MainForm: RunTest() Started GetVisibleLayers Scale=256972.111553785 Name=SDE.县级居民地point MinimumScale=0, MaximumScale=0, Valid=True, Visible=True ADDED Layer=SDE.县级居民地point Name=SDE.地市级以上居民地4m MinimumScale=0, MaximumScale=0, Valid=True, Visible=True ADDED Layer=SDE.地市级以上居民地4m Name=SDE.首都和省级行政中心4m MinimumScale=0, MaximumScale=0, Valid=True, Visible=True ADDED Layer=SDE.首都和省级行政中心4m Name=SDE.地级行政界线polyline MinimumScale=0, MaximumScale=0, Valid=True, Visible=True ADDED Layer=SDE.地级行政界线polyline Name=SDE.五级河流polyline MinimumScale=0, MaximumScale=0, Valid=True, Visible=True ADDED Layer=SDE.五级河流polyline Name=SDE.主要铁路4m MinimumScale=0, MaximumScale=0, Valid=True, Visible=True ADDED Layer=SDE.主要铁路4m Name=SDE.主要公路4m MinimumScale=0, MaximumScale=0, Valid=True, Visible=True ADDED Layer=SDE.主要公路4m Name=SDE.国界与省界4l MinimumScale=0, MaximumScale=0, Valid=True, Visible=True ADDED Layer=SDE.国界与省界4l Name=SDE.三级以上河流4l MinimumScale=0, MaximumScale=0, Valid=True, Visible=True ADDED Layer=SDE.三级以上河流4l Name=SDE.国界4l MinimumScale=0, MaximumScale=0, Valid=True, Visible=True ADDED Layer=SDE.国界4l Name=SDE.四级河流polyline MinimumScale=0, MaximumScale=0, Valid=True, Visible=True ADDED Layer=SDE.四级河流polyline Name=SDE.一级河流4l MinimumScale=0, MaximumScale=0, Valid=True, Visible=True ADDED Layer=SDE.一级河流4l Name=SDE.县级行政界线line MinimumScale=0, MaximumScale=0, Valid=True, Visible=True ADDED Layer=SDE.县级行政界线line Name=SDE.国界与省界4p MinimumScale=0, MaximumScale=0, Valid=True, Visible=True ADDED Layer=SDE.国界与省界4p Name=SDE.三级以上河流4p MinimumScale=0, MaximumScale=0, Valid=True, Visible=True ADDED Layer=SDE.三级以上河流4p Name=SDE.国界4p MinimumScale=0, MaximumScale=0, Valid=True, Visible=True ADDED Layer=SDE.国界4p Name=SDE.一级河流4p MinimumScale=0, MaximumScale=0, Valid=True, Visible=True ADDED Layer=SDE.一级河流4p Name=SDE.县级行政界线poly MinimumScale=0, MaximumScale=0, Valid=True, Visible=True ADDED Layer=SDE.县级行政界线poly 2012-3-14 9:55:04 Testing scale=250000 layer= 1 SDE.县级居民地point 2012-3-14 9:55:05Cursor features: layer=SDE.县级居民地point features=4 layer=SDE.县级居民地point Vertices=0 Features=0 LayerVertices=0 layer= 2 SDE.地市级以上居民地4m 2012-3-14 9:55:06Cursor features: layer=SDE.地市级以上居民地4m features=0 layer=SDE.地市级以上居民地4m Vertices=0 Features=0 LayerVertices=0 layer= 3 SDE.首都和省级行政中心4m 2012-3-14 9:55:06Cursor features: layer=SDE.首都和省级行政中心4m features=0 layer=SDE.首都和省级行政中心4m Vertices=0 Features=0 LayerVertices=0 layer= 4 SDE.地级行政界线polyline 2012-3-14 9:55:07Cursor features: layer=SDE.地级行政界线polyline features=0 layer=SDE.地级行政界线polyline Vertices=0 Features=0 LayerVertices=0 layer= 5 SDE.五级河流polyline 2012-3-14 9:55:08Cursor features: layer=SDE.五级河流polyline features=1 layer=SDE.五级河流polyline Vertices=109 Features=1 LayerVertices=109 layer= 6 SDE.主要铁路4m 2012-3-14 9:55:08Cursor features: layer=SDE.主要铁路4m features=0 layer=SDE.主要铁路4m Vertices=0 Features=0 LayerVertices=0 layer= 7 SDE.主要公路4m 2012-3-14 9:55:09Cursor features: layer=SDE.主要公路4m features=0 layer=SDE.主要公路4m Vertices=0 Features=0 LayerVertices=0 layer= 8 SDE.国界与省界4l 2012-3-14 9:55:10Cursor features: layer=SDE.国界与省界4l features=2 layer=SDE.国界与省界4l Vertices=374 Features=2 LayerVertices=374 layer= 9 SDE.三级以上河流4l 2012-3-14 9:55:11Cursor features: layer=SDE.三级以上河流4l features=3 layer=SDE.三级以上河流4l Vertices=67 Features=3 LayerVertices=67 layer= 10 SDE.国界4l 2012-3-14 9:55:11Cursor features: layer=SDE.国界4l features=0 layer=SDE.国界4l Vertices=0 Features=0 LayerVertices=0 layer= 11 SDE.四级河流polyline 2012-3-14 9:55:12Cursor features: layer=SDE.四级河流polyline features=1 layer=SDE.四级河流polyline Vertices=53 Features=1 LayerVertices=53 layer= 12 SDE.一级河流4l 2012-3-14 9:55:13Cursor features: layer=SDE.一级河流4l features=1 layer=SDE.一级河流4l Vertices=65 Features=1 LayerVertices=65 layer= 13 SDE.县级行政界线line 2012-3-14 9:55:14Cursor features: layer=SDE.县级行政界线line features=15 layer=SDE.县级行政界线line Vertices=724 Features=15 LayerVertices=724 layer= 14 SDE.国界与省界4p 2012-3-14 9:55:14Cursor features: layer=SDE.国界与省界4p features=2 layer=SDE.国界与省界4p Vertices=7046 Features=2 LayerVertices=7046 layer= 15 SDE.三级以上河流4p 2012-3-14 9:55:15Cursor features: layer=SDE.三级以上河流4p features=0 layer=SDE.三级以上河流4p Vertices=0 Features=0 LayerVertices=0 layer= 16 SDE.国界4p 2012-3-14 9:55:16Cursor features: layer=SDE.国界4p features=1 layer=SDE.国界4p Vertices=46220 Features=1 LayerVertices=46220 layer= 17 SDE.一级河流4p 2012-3-14 9:55:17Cursor features: layer=SDE.一级河流4p features=0 layer=SDE.一级河流4p Vertices=0 Features=0 LayerVertices=0 layer= 18 SDE.县级行政界线poly 2012-3-14 9:55:18Cursor features: layer=SDE.县级行政界线poly features=8 layer=SDE.县级行政界线poly Vertices=2848 Features=8 LayerVertices=2848 2012-3-14 9:55:19 RunTest:LoadXML 2012-3-14 9:55:19 RunTest: ESRI.ArcGIS.ADF.COMSupport.AOUninitialize.Shutdown() 2012-3-14 9:55:19 RunTest: ESRI.ArcGIS.ADF.COMSupport.AOUninitialize.Shutdown() Completed 2012-3-14 9:55:19 RunTest:Application.Exit() 2012-3-14 9:55:19 After RunTest:Application.Exit() 2012-3-14 9:55:19 Dspose: ESRI.ArcGIS.ADF.COMSupport.AOUninitialize.Shutdown() 2012-3-14 9:55:19 Dspose: ESRI.ArcGIS.ADF.COMSupport.AOUninitialize.Shutdown() Completed
我们在该目录下得到一个XML文件
2012-3-14 9:55:19
c:\1.mxd
layerCount= 18
Unknown
esriDecimalDegrees
X= 104.25 Y= 28.48 width= 1920 height= 1028
Scale | Refresh Time(sec) | VisibleLayers |
---|---|---|
256,972 | .43 | 18 |
Item | At Scale | Layer Name | Refresh Time (sec) | Recommendations | Features | Vertices | Labeling | Geography Phase (sec) | Graphics Phase (sec) | Cursor Phase (sec) | DBMS CPU | DBMS LIO | DBMS PIO | Source | LayerType | Layer Spatial Reference | LayerQueryDef |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | 256,972 | SDE.县级居民地point | .02 | avoid projecting on the fly; | 4 | False | .01 | .00 | .00 | .00 | esriDBMS_Oracle,192.168.220.165,5151,sde | esriGeometryPoint | GCS_WGS_1984 | ||||
2 | 256,972 | SDE.地市级以上居民地4m | .03 | avoid projecting on the fly; | False | .01 | .00 | .00 | .00 | esriDBMS_Oracle,192.168.220.165,5151,sde | esriGeometryPoint | GCS_WGS_1984 | |||||
3 | 256,972 | SDE.首都和省级行政中心4m | .02 | avoid projecting on the fly; | False | .01 | .00 | .00 | .00 | esriDBMS_Oracle,192.168.220.165,5151,sde | esriGeometryPoint | GCS_WGS_1984 | |||||
4 | 256,972 | SDE.地级行政界线polyline | .02 | avoid projecting on the fly; | False | .01 | .00 | .00 | .00 | esriDBMS_Oracle,192.168.220.165,5151,sde | esriGeometryPolyline | GCS_WGS_1984 | |||||
5 | 256,972 | SDE.五级河流polyline | .02 | avoid projecting on the fly; | 1 | 109 | False | .01 | .00 | .00 | .00 | esriDBMS_Oracle,192.168.220.165,5151,sde | esriGeometryPolyline | GCS_WGS_1984 | |||
6 | 256,972 | SDE.主要铁路4m | .02 | avoid projecting on the fly; | False | .01 | .00 | .00 | .00 | esriDBMS_Oracle,192.168.220.165,5151,sde | esriGeometryPolyline | GCS_WGS_1984 | |||||
7 | 256,972 | SDE.主要公路4m | .02 | avoid projecting on the fly; | False | .01 | .00 | .00 | .00 | esriDBMS_Oracle,192.168.220.165,5151,sde | esriGeometryPolyline | GCS_WGS_1984 | |||||
8 | 256,972 | SDE.国界与省界4l | .02 | avoid projecting on the fly; | 2 | 374 | False | .01 | .00 | .00 | .00 | esriDBMS_Oracle,192.168.220.165,5151,sde | esriGeometryPolyline | GCS_WGS_1984 | |||
9 | 256,972 | SDE.三级以上河流4l | .02 | avoid projecting on the fly; | 3 | 67 | False | .01 | .00 | .00 | .00 | 1 | esriDBMS_Oracle,192.168.220.165,5151,sde | esriGeometryPolyline | GCS_WGS_1984 | ||
10 | 256,972 | SDE.国界4l | .02 | avoid projecting on the fly; | False | .01 | .00 | .00 | .00 | esriDBMS_Oracle,192.168.220.165,5151,sde | esriGeometryPolyline | GCS_WGS_1984 | |||||
11 | 256,972 | SDE.四级河流polyline | .02 | avoid projecting on the fly; | 1 | 53 | False | .01 | .00 | .00 | .00 | esriDBMS_Oracle,192.168.220.165,5151,sde | esriGeometryPolyline | GCS_WGS_1984 | |||
12 | 256,972 | SDE.一级河流4l | .03 | avoid projecting on the fly; | 1 | 65 | False | .01 | .00 | .00 | .00 | esriDBMS_Oracle,192.168.220.165,5151,sde | esriGeometryPolyline | GCS_WGS_1984 | |||
13 | 256,972 | SDE.县级行政界线line | .03 | avoid projecting on the fly; | 15 | 724 | False | .02 | .00 | .00 | .00 | esriDBMS_Oracle,192.168.220.165,5151,sde | esriGeometryPolyline | GCS_WGS_1984 | |||
14 | 256,972 | SDE.国界与省界4p | .05 | avoid projecting on the fly; | 2 | 7,046 | False | .03 | .01 | .02 | .00 | esriDBMS_Oracle,192.168.220.165,5151,sde | esriGeometryPolygon | GCS_WGS_1984 | |||
15 | 256,972 | SDE.三级以上河流4p | .02 | avoid projecting on the fly; | False | .01 | .00 | .00 | .00 | esriDBMS_Oracle,192.168.220.165,5151,sde | esriGeometryPolygon | GCS_WGS_1984 | |||||
16 | 256,972 | SDE.国界4p | .26 | simplify geometry: vertices fetched=46220; avoid projecting on the fly; | 1 | 46,220 | False | .25 | .00 | .12 | .00 | 1 | esriDBMS_Oracle,192.168.220.165,5151,sde | esriGeometryPolygon | GCS_WGS_1984 | ||
17 | 256,972 | SDE.一级河流4p | .02 | avoid projecting on the fly; | False | .01 | .00 | .00 | .00 | esriDBMS_Oracle,192.168.220.165,5151,sde | esriGeometryPolygon | GCS_WGS_1984 | |||||
18 | 256,972 | SDE.县级行政界线poly | .03 | avoid projecting on the fly; | 8 | 2,848 | False | .02 | .00 | .01 | .00 | esriDBMS_Oracle,192.168.220.165,5151,sde | esriGeometryPolygon | GCS_WGS_1984 |