When adding the Sketch widget to a map, the FeatureSnappingEngine fires off a request to query the extent of a private feature service of ours that has 140M records. This is happening even though we have all snapping features disabled in the config:
this.sketch = new Sketch({
view: this.view,
layer: this.graphicsLayer,
availableCreateTools: ["point", "polygon", "circle"],
snappingOptions: {
featureEnabled: false,
enabled: false,
selfEnabled: false,
},
visibleElements: {
createTools: { polyline: false },
selectionTools: { "rectangle-selection": false, "lasso-selection": false },
settingsMenu: false,
},
creationMode: "single",
defaultUpdateOptions: {
tool: "reshape"
}
});
The request url looks like this:
https://example.com/arcgis/rest/services/PROD/ServiceName/MapServer/0/query?f=json&returnExtentOnly=true&returnCountOnly=true&outSR=102100&returnGeometry=false&spatialRel=esriSpatialRelIntersects&where=1%3D1&token=K2QQ07z....REDACTED....
I found someone else asking about snapping performance here: https://community.esri.com/t5/arcgis-api-for-javascript-questions/snapping-performance-issue-in-vers... They show a similar request being fired.
I believe this request ends up triggering a query on our postgres database that looks like this:
DECLARE sdecur_190_7264 BINARY CURSOR WITH HOLD FOR
select objectid, st_asewkb(ST_setSRID(parcels_all.shape,-1)) AS shape,
nlrgis.sde.parcels_all.GDB_GEOMATTR_DATA from nlrgis.sde.parcels_all
where (( 1=1 )) and ((sde.parcels_all.shape &&
public.ST_setSRID(public.ST_GeomFromEWKB($1),3857)) = 't')
Since we have 140M records in our database, and it's querying with 1=1, it takes over a minute to complete. When we have just a couple users loading this map, the database server becomes overloaded and ArcGIS Server starts to timeout all requests. We're running ArcGIS Enterprise 10.9.1 and ArcGIS JS 4.22 if that helps.
Is there a way to prevent the query for the snapping extent from being requested?