ST_GEOMETRY queries on an SDE view from a remote account = not using domain index
Hello -
I was just wondering if anyone had any thoughts on this.
We have found that whenever an ST_GEOMETRY query is run against an SDE view from a remote account, the query takes a very long time by comparison to that same SDE view being created in the account the query is run from. Running the same/similar ST_GEOMETRY query on the underlying feature class runs in about the same time whether from the account that owns the feature class or from a remote account.
From looking at execution plans, it seems that when doing an ST_GEOMETRY query (such as SDE.ST_INTERSTECTS) on an SDE view from a remote account, the domain index on the underlying feature class is not used. Whereas, if the same query is run from the account that owns the SDE view, the domain index is used in the execution plan. This is true even when the underlying feature class is on a different account.
For instance, we have the following:
GISLIB.PARCELS = feature class of 3 million+ parcel records
GISLIB.V_PARCELS = view of the GISLIB.PARCELS fields (all fields minus shape), with different field names (required by web apps)
We created an SDE view using the sdetable command:
sdetable -o create_view -T PARCELS_ALL -t "parcels, v_parcels" -c "v_parcels.objectid, v_parcels.county, v_parcels.parcelid, v_parcels.oname, v_parcels.onaddr1, parcels.shape" -w "v_parcels.objectid=parcels.objectid" -i esri_sde -s earth -u gislib -p *****
In the above example, when doing an ST_GEOMETRY query on the PARCELS_ALL view when connected as GISLIB works fast. When doing this same query from another account (example the GISAPP account), the query seems to not work and will just sit there. From the execution plan, it turns out that it is doing a full table scan of the original feature class and is not using the domain index.
But, if this same PARCELS_ALL view is created in the account the query is to be run from, the ST_GEOMETRY query is relatively fast and looking at the execution plan does use the domain index of the feature class:
sdetable -o create_view -T PARCELS_ALL -t "gislib.parcels_all, gislib.v_parcels_all" -c "gislib.v_parcels_all.objectid, gislib.v_parcels_all.county, gislib.v_parcels_all.parcelid, gislib.v_parcels_all.oname, gislib.v_parcels_all.onaddr1, gislib.parcels_all.shape" -w "gislib.v_parcels_all.objectid=gislib.parcels_all.objectid" -i esri_sde -s earth -u gisapp -p ****
Our external web applications use and query SDE views a lot, and we've gotten around this issue by creating the same SDE views in each of the accounts used by the web applications. This isn't our preference - we'd prefer to have one set of SDE views in one main account - but can do this.
Again, I was just wondering if anyone might have thoughts on things we might try.
We are using: Oracle 11.2.0.1, ArcSDE 10 sp3
Thanks -
Ellen Dean
St. Johns River Water Management District