Andres:
Have you been able to publish your view as a mapservice? If so, have do you plan on using the data (e.g. Do you intend to perform queries on the mapservice and it's associated view? I have been working with a view from Oracle and I am encountering fundamental flaws with how the client is communicating back to the database (where clause and sort by appears to be dropped when the SQL statement is sent to the database.
Here are some threads that touch on these issues and I don't believe they are database specific so it would occur in Oracle, SQL Server, Postgres:
Fundamental flaw when opening attribute tables in ArcGIS Pro?
https://community.esri.com/thread/216276-available-values-for-a-query-layer-subset-selection
Spoke to ESRI support, and, as Brent above said, Spatial Indexes cannot be created on views.
They can only be created on the underlying fc and table that the view references.
Another option may be to add multicolumn attribute indexes on fields from the underlying fc’s and tables that will be queried in the view.
Read
http://desktop.arcgis.com/en/arcmap/10.3/manage-data/tables/creating-attribute-indexes.htm
Hi Anthony,
Can you please expand on this?
We can message if you like?
I am trying to publish a view as a map service, but I get the high warning message saying that the view does not have a spatial index.
Any thoughts?
I am on
Microsoft SQL server 2014.120.5579.0
EGDB is 10.4.1
I found these resources, but would like some help:
http://desktop.arcgis.com/en/arcmap/10.4/manage-data/using-sql-with-gdbs/create-spatial-indexes-on-tables-with-an-st-geometry-column.htm
But there is no information on doing this on Microsoft SQL server.
Listing 2 on this (http://www.esri.com/news/arcuser/1012/files/querylayers.pdf) article says:
<SPAN class="keyword token">create</SPAN> spatial <SPAN class="keyword token">index</SPAN> MyTABLE _ shape <SPAN class="keyword token">on</SPAN> MyTABLE _ tbl <SPAN class="punctuation token">(</SPAN>shape<SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">USING</SPAN> <SPAN class="keyword token">GEOMETRY</SPAN> _ GRID <SPAN class="keyword token">WITH</SPAN> <SPAN class="punctuation token">(</SPAN>BOUNDING _ BOX <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">(</SPAN>Xmin<SPAN class="punctuation token">,</SPAN>Ymin<SPAN class="punctuation token">,</SPAN>Xmax<SPAN class="punctuation token">,</SPAN>Ymax<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN></SPAN>
Hi,I too have seen this issue before long ago. Please post your environment info along with a sdelayer -o describe_long of the feature class and spatial view.In my situation, i believe my problem was passing the wrong srid to view creation command that prevented the use of the spatial index.good luck,Anthony
When creating a spatial view, ArcGIS will not create a spatial index (or any index) on the view (DBMS' may not support indexes on view at all unless it is a materialized view), the key aspect is to make sure the underlying database tables that are referenced in the view have the appropriate indexes.Hope this helps,-Brent
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.